《軟件自動(dòng)化測(cè)試成功之道》讀書筆記_第1頁(yè)
《軟件自動(dòng)化測(cè)試成功之道》讀書筆記_第2頁(yè)
《軟件自動(dòng)化測(cè)試成功之道》讀書筆記_第3頁(yè)
《軟件自動(dòng)化測(cè)試成功之道》讀書筆記_第4頁(yè)
《軟件自動(dòng)化測(cè)試成功之道》讀書筆記_第5頁(yè)
已閱讀5頁(yè),還剩8頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、TIB自動(dòng)化測(cè)試工作室軟件自動(dòng)化測(cè)試成功之道讀書筆記(1 )軟件自動(dòng)化測(cè)試成功之道學(xué)習(xí)路線:1、學(xué)習(xí)光盤附帶的 TestComplete和QTP的視頻2、 學(xué)習(xí)TestComplete 和QTP、軟件自動(dòng)化測(cè)試成功之道、QTP自動(dòng)化測(cè)試進(jìn)階3、使用TestComplete 、QTP等自動(dòng)化測(cè)試工具進(jìn)行自動(dòng)化測(cè)試實(shí)踐 參考: is believing/category/672903.aspxTestCompleteAutomatedQA公司的自動(dòng)化測(cè)試工具。主要特點(diǎn):支持 VB Script、JScript、Delphi Script、C+ Script > C#Script 作為腳本語(yǔ)言

2、。一個(gè)工具就能 支持功能自動(dòng)化測(cè)試、 WEB負(fù)載測(cè)試、分布式測(cè)試、單元測(cè)試等。價(jià)格便宜:$999目前最新版本:7.52下載地址: nl oads/testcomplete/選擇自動(dòng)化測(cè)試工具需要考慮的19個(gè)方面在為自動(dòng)化測(cè)試項(xiàng)目做工具選型時(shí),需要考慮以下幾個(gè)方面的因素來(lái)決定選擇哪個(gè)自動(dòng)化測(cè)試工具:1、對(duì)不同類型的應(yīng)用程序和平臺(tái)的支持。2、對(duì)不同類型的操作系統(tǒng)的支持。3、對(duì)不同的測(cè)試類型的支持。4、腳本語(yǔ)言、編輯器和調(diào)試器。5、錄制測(cè)試腳本的能力。6、應(yīng)對(duì)變化的能力。7、對(duì)控件和對(duì)象的支持。8、支持不同渠道的測(cè)試數(shù)據(jù)。9、運(yùn)行測(cè)試與測(cè)試對(duì)象的同步。10、檢查點(diǎn)。11、測(cè)試結(jié)果記錄和導(dǎo)出報(bào)告。12

3、、擴(kuò)展性。13、測(cè)試多語(yǔ)言應(yīng)用程序的能力。14、對(duì)團(tuán)隊(duì)協(xié)作和源代碼管理的支持。15、對(duì)命令行和 OLE 自動(dòng)化的支持。16、與團(tuán)隊(duì)協(xié)作系統(tǒng)以及軟件構(gòu)建系統(tǒng)的整合。17、技術(shù)支持。18、價(jià)格。19、試用版。軟件自動(dòng)化測(cè)試成功之道讀書筆記(2)學(xué)習(xí)軟件自動(dòng)化測(cè)試成功之道附帶光盤中的 TestComplete 基礎(chǔ)教程 :1 TC 簡(jiǎn)介 .swf2 安裝 .swf3 White-Box Application.swf4 項(xiàng)目創(chuàng)建( 1) .swf5 項(xiàng)目創(chuàng)建( 2) .avi.swf6 運(yùn)行 AUT.swf7 Code Complete.swf8 錄制腳本 .swfTestComplete 6 中錄

4、制回放功能的使用介紹(視頻) : TC8.0 不僅修改了錄制工具欄的設(shè)計(jì),易用性更強(qiáng)了,可在錄制時(shí)修改腳本名。而且在 Opetions->Engines -> Recording 中提供了“ Record user actions over tested applications only 選項(xiàng),可以讓你僅僅錄制選定的被測(cè)試程序。另外,錄制時(shí)會(huì)自動(dòng)存儲(chǔ)映射對(duì)象的方法和屬性, 這樣錄制完成后, 即使關(guān)閉了被測(cè)試對(duì)象, 也能訪問(wèn)對(duì)象的方法和屬性。學(xué)習(xí)軟件自動(dòng)化測(cè)試成功之道 第 2 章 自動(dòng)化測(cè)試工具Windows 的 API 中 封裝了很多可用于自動(dòng)化測(cè)試編程的函數(shù),例如 FindWi

5、ndow 、 GetWindowRect 等函數(shù)。 這些函數(shù)可在編程語(yǔ)言或腳本代碼中進(jìn)行調(diào)用, 從而實(shí)現(xiàn)自動(dòng)化測(cè) 試編程。安裝 IE Developer ToolBar ,學(xué)習(xí) DOM 相關(guān)知識(shí) ( 1)常用 DOM 屬性className.同一樣式規(guī)則的元素用相同的類名??赏ㄟ^(guò)className快速過(guò)濾出一組類似的元素。docume nt.用于指向包含當(dāng)前元素的文檔對(duì)象。id .當(dāng)前元素的標(biāo)識(shí)。如果文檔中包含多個(gè)相同 id 的元素,則返回一個(gè)數(shù)組。 innerHTML. 用于指向當(dāng)前元素的開始標(biāo)記和結(jié)束標(biāo)記之間的所有文本和HTML 標(biāo)簽。innerText.用于指向當(dāng)前元素的開始標(biāo)記和結(jié)束標(biāo)

6、記之間的所有文本和HTML標(biāo)簽。offsetHeight, offsetWidth. 元素的高度和寬度。offsetLeft, offsetTop. 當(dāng)前元素相同對(duì)于父親元素的左邊位置和頂部位置。 outerHTML. 當(dāng)前元素的開始標(biāo)記和結(jié)束標(biāo)記之間的所有文本和 HTML 標(biāo)簽。 outerText.當(dāng)前元素的開始標(biāo)記和結(jié)束標(biāo)記之間的所有文本,但不包括HTML標(biāo)簽。paren tEleme nt.當(dāng)前元素的父親元素。source In dex .元素在 docume nt.all 集合中的索弓丨(in dex )。style.元素的樣式表單屬性。tagName.當(dāng)前元素的標(biāo)簽名。title.

7、 在 IE 中,代表元素的 tool tip 文本。2) 常用 DOM 方法click(). 模擬用戶對(duì)當(dāng)前元素的鼠標(biāo)點(diǎn)擊。con tai ns(eleme nt).用于判斷當(dāng)前元素是否包含指定的元素。 getAttribute(attributeName, caseSensitive). 返回當(dāng)前元素所包含的某個(gè)屬性,參數(shù) attributeName為屬性名、caseSensitive表示是否大小寫敏感。setAttribute(attributeName, value, caseSenstive). 設(shè)置當(dāng)前元素的屬性。3) 常用 DOM 集合All. 當(dāng)前元素中包含的所有 HTML 元素

8、的數(shù)組。 children. 當(dāng)前元素包含的孩子元素。使用 HTML DOM 進(jìn)行自動(dòng)化測(cè)試的簡(jiǎn)單例子把下面VBScript腳本另存為 GoogleTest.vbs,雙擊運(yùn)行:Dim oIee, objeditDim oPagtxtSet oIee = CreateObject("InternetExplorer.Application")oIee.navigate (".hk") oIee.Visible = TrueDo While oIee.readystate <> 4LoopSet oPagtxt = oIee.documentse

9、t objedit = oPagtxt.getelementsbyname("q")objedit(0).value = "QTP 自動(dòng)化測(cè)試進(jìn)階”set objbutt on = oPagtxt.geteleme ntsb yn ame("bt nG") objbutto n( 0).CIickSet oIee = Noth ing對(duì)于TC而言,C、C+、Delphi等程序,被稱為 Black Box應(yīng)用程序,而像.NET、JAVA等 基于中間代碼構(gòu)建的應(yīng)用程序,被稱為White Box應(yīng)用程序。參考:http:/www.doci 軟件自動(dòng)化

10、測(cè)試成功之道讀書筆記(3)學(xué)習(xí)軟件自動(dòng)化測(cè)試成功之道附帶光盤中的 TestComplete基礎(chǔ)教程:9 Object Browser ( 1) .swf10 Object Browser ( 2) .avi.swf11 Object Browser ( 3) .avi.swfTC的對(duì)象瀏覽器提供了強(qiáng)大的查看界面對(duì)象屬性、方法的功能。在自動(dòng)化測(cè)試腳本編寫過(guò) 程中需要經(jīng)常使用的工具!官方主頁(yè)上關(guān)于 TC Object Browser的介紹: TestComplete 6中對(duì)象瀏覽器(Object Browser)的使用介紹(視頻) Usi ng The Object Browser in g Th

11、e Object Browser.aspx轉(zhuǎn)載:TestComplete對(duì)象瀏覽器(Object Browser )和進(jìn)程相互影響以及解決辦法前兩天,剛剛學(xué)習(xí)使用TestComplete (以下簡(jiǎn)稱 TC)錄制腳本,在錄制過(guò)程中,發(fā)現(xiàn)TC的對(duì)象瀏覽器(Object Browser,以下簡(jiǎn)稱OB)和被測(cè)程序本身或者其調(diào)用和產(chǎn)生的進(jìn)程存 在著相互的影響。因?yàn)镺B本身的功能就是顯示當(dāng)前系統(tǒng)的所有進(jìn)程,而當(dāng)被測(cè)程序在運(yùn)行過(guò)程中生成了某個(gè)實(shí)例(比如Word,Excel等等),那么由于 OB的存在,此時(shí)被測(cè)程序是 無(wú)法通過(guò)釋放實(shí)例來(lái)將其進(jìn)程銷毀的!此時(shí) OB 的現(xiàn)象是無(wú)法刷新!因此,只能使用強(qiáng)制結(jié) 束進(jìn)程

12、的方法將進(jìn)程過(guò)掉后,腳本才能正?;胤懦晒Γ≤浖詣?dòng)化測(cè)試成功之道讀書筆記(4)學(xué)習(xí)軟件自動(dòng)化測(cè)試成功之道附帶光盤中的 TestComplete 基礎(chǔ)教程 :12 Test Log( 1) .swf13 Test Log( 2) .swf14 Test Log( 3) .swf測(cè)試日志記錄是自動(dòng)化測(cè)試不可獲取的一部分, 詳細(xì)的日志記錄有助于腳本的調(diào)試和軟件的 問(wèn)題分析。TestComplete 附帶的 Sample 中有專門一個(gè)例子 Test Log 講解如何寫入各種測(cè)試日志Illustrates posting a variety of pictures and messages to the

13、 test log and organizingthem as a hierarchy of folders in the test log.<TestComplete Samples>ScriptsTest LogTC 的 Log 可以寫 6 種類型的信息: Message - Can come from TestComplete or from the script code (Log.Message), will not cause the test to fail. Warning - Can come from TestComplete or from the scrip

14、t code (Log.Warning), not necessary a failure for the test but could be an indicator for why a test failed. Error - Can come from TestComplete or from the script code (Log.Error), this indicates a failure for the test. Events - Usually comes from TestComplete but can come from the script as well (Lo

15、g.Event), does not cause the test to fail. TestComplete generates an event for every mouse-click or keyboard entry in the test. Image - Usually comes from script code (Log.Picture) but TestComplete can generate as well (Region Checkpoints). File - There are two types of File log items. Log.File, wil

16、l copy the file into the directory holding the log XML file and creates a hyperlink to the file. Log.Link just creates a hyperlink to the file without copying the file.軟件自動(dòng)化測(cè)試成功之道讀書筆記( 5)TestComplete 基礎(chǔ)教程 :學(xué)習(xí)軟件自動(dòng)化測(cè)試成功之道附帶光盤中的15 調(diào)試腳本 .swf調(diào)試是腳本開發(fā)的基本功!step into 表示調(diào)試時(shí)碰到函數(shù)將進(jìn)入函數(shù)體內(nèi) step over 表示調(diào)試時(shí)一步一行跳過(guò) ru

17、n to cursor 表示運(yùn)行到光標(biāo)所在行后停住 用 VBScript 的 MsgBox 顯示信息,或者把變量、對(duì)象屬性、數(shù)據(jù)等寫入 Log 也是一種很好 的調(diào)試方法!參考視頻:在 TC 中調(diào)試腳本: Debugging Automated Test Scripts With TestCompleteDescribes the automated test script debugging features provided by TestComplete.TestComplete 代碼基本調(diào)試技巧:TestComplete Basic Debugging 軟件自動(dòng)化測(cè)試成功之道讀書筆記(

18、6)學(xué)習(xí)軟件自動(dòng)化測(cè)試成功之道附帶光盤中的 TestComplete 基礎(chǔ)教程 :16 比較文件( 1) .swf17 比較文件( 2) .swf18 比較對(duì)象屬性 .swf檢查點(diǎn)是自動(dòng)化測(cè)試必不可少的部分, 就像測(cè)試用例如果缺少了最后的測(cè)試結(jié)果檢查就不是 完整的測(cè)試用例一樣, 自動(dòng)化測(cè)試腳本中也需要添加檢查步驟。 一般通過(guò)檢查控件對(duì)象的屬 性、文件、數(shù)據(jù)庫(kù)數(shù)據(jù)等來(lái)判斷測(cè)試是否通過(guò)。TestComplete 支持 Region、File 、 Object 等類型的檢查點(diǎn)。Region CheckPoint 的例子:Sub RegionCompareExampleIf (Not Regions

19、.Compare("Logo", Sys.Process("iexplore"). _Page("0). _Link(0).Image("nav_r1_c1"),False, False, True , 0) ThenCallLog .Error("The regions are not identical.")EndIfEndSubFile CheckPoint 的例子:SubFileCompareExampleIf (Not Files .Compare("Sample1.txt"

20、, "Sample2.txt", 0, True) ThenCallLog .Error("The files are not identical.")EndIfEndSubObject CheckPoint 的例子:SubObjectCompareExampleIf(NotObjects .Compare(Sys.Process("iexplore").Page(" "Panel", True ) ThenCallLog .Error("The objects are not identica

21、l.")EndIfEnd Sub參考TestComplete附帶的Sample例子進(jìn)行練習(xí):Checkpoi nts Samples(檢查點(diǎn)的使用)TestComplete in cludes a nu mber of samples that dem on strate how to performvarious kinds of checkpo intsDatabase Table Checkpo ints(數(shù)據(jù)表檢查點(diǎn)):<TestCompleteSamples>ScriptsCheckpo in tsSamples'DatabaseTableCheckpo

22、 in tsFile Checkpo ints(文件檢查點(diǎn)):<TestComplete Samples>ScriptsCheckpo in tsSamplesFileCheckpo in tsObject Checkpo ints(對(duì)象檢查點(diǎn)):<TestComplete Samples>ScriptsCheckpo in tsSamplesObjectCheckpo in tsProperty Checkpo ints(屬性檢查點(diǎn)):<TestComplete Samples>ScriptsCheckpo in tsSamples'Propert

23、yCheckpo in tsRegio n Checkpo ints(區(qū)域檢查點(diǎn)):<TestComplete Samples>ScriptsCheckpo in tsSamplesRegi on Checkpo in tsTable Checkpo ints(表格檢查點(diǎn)):(Web可訪問(wèn)性檢查點(diǎn))<TestComplete Samples>ScriptsCheckpo in tsSamples'TableCheckpo intsWebAccessibility Checkpo ints <TestCompleteSamples>ScriptsChe

24、ckpo in tsSamples'WebAccessibilityCheckpo in ts(Web對(duì)比檢查點(diǎn))WebComparis on Checkpo ints <TestCompleteSamples>ScriptsCheckpoi ntsSamples'WebComparis on Checkpoi ntsWeb Service Checkpo ints(Web Service檢查點(diǎn))<TestComplete Samples>ScriptsCheckpo in tsSamples'WebServiceCheckpo in tsXML

25、 Checkpoints(XML 檢查點(diǎn)):<TestComplete Samples>ScriptsCheckpoi ntsSamplesXMLCheckpoi ntsTestComplete 6中對(duì)象檢查點(diǎn)的使用介紹(視頻):Object Checkpo ints Checkpoints.aspx在TestComplete的關(guān)鍵字視圖中如何使用 Stores和Checkpoints 進(jìn)行對(duì)象屬性、表格數(shù)據(jù)、文件的檢查?(視頻):Using Stores & Checkpo ints in a TestComplete Keyword TestIn this video

26、we look using Stores & Checkpoints, a powerful feature ofTestComplete, providi ng the ability to capture test data duri ng test record ing. Weexam ine TestComplete v7 ' s new Checkpo int Wizard feature and in corporate thefollow ing Checkpo ints with in the test:* Object (multiple object/pro

27、perty comparis on)* Table, verify ing tabular data * File, comparing data created during the test Stores amp Checkpoints in a Tes tComplete Keyword Test.aspx如何在TestComplete 中整合Beyond Compare進(jìn)行文件比較?(視頻)TestComplete file compare with Beyond Compare file compare with BeyondCompare.aspx軟件自動(dòng)化測(cè)試成功之道讀書筆記(7

28、)學(xué)習(xí)軟件自動(dòng)化測(cè)試成功之道附帶光盤中的TestComplete基礎(chǔ)教程:19數(shù)據(jù)驅(qū)動(dòng)(1) .swf20數(shù)據(jù)驅(qū)動(dòng)(2) .swfTC用DDT來(lái)支持?jǐn)?shù)據(jù)驅(qū)動(dòng)測(cè)試,DDT包括3種類型:(1) CVSDriver is used to read text file such as comma delimited (default) or tab delimited (us ing a schema.i ni file). By default the first row is the header in formatio n (or colu mn n ames) for the driver.(

29、2) ExcelDriver is used to read an Excel spreadsheet. The first row of the sheet is the header in formatio n for the driver.(3) ADODriver is a gen eric driver to read in ADO compatible data source.閱讀軟件自動(dòng)化測(cè)試成功之道的第6章“自動(dòng)化測(cè)試框架的搭建”數(shù)據(jù)驅(qū)動(dòng)框架與關(guān)鍵字驅(qū)動(dòng)框架類似,測(cè)試數(shù)據(jù)都存儲(chǔ)在數(shù)據(jù)庫(kù)或 Excel文件,但是數(shù)據(jù)驅(qū) 動(dòng)框架的測(cè)試用例、 測(cè)試步驟和測(cè)試邏輯是在測(cè)試腳本中編寫的,

30、而不像關(guān)鍵字驅(qū)動(dòng)框架一 樣放在表格中。腳本從表格中讀入測(cè)試數(shù)據(jù), 包括測(cè)試輸入的數(shù)據(jù), 測(cè)試結(jié)果驗(yàn)證的數(shù)據(jù)。 通過(guò)循環(huán)遍歷數(shù) 據(jù)表格中的所有行,可以極大地增大測(cè)試覆蓋面,測(cè)試各種輸入條件下應(yīng)用程序的表現(xiàn)。學(xué)習(xí) TestComplete 附帶的 Sample:DDT (數(shù)據(jù)驅(qū)動(dòng)測(cè)試)This sample is used by the Data-Drive n Testi ng Tutorial that describes a step-by-step procedure of creati ngdata-drive n testsin TestComplete. The scripttest

31、s the OrdersDemo applicati on, which is used to con figure a table of purchase orders. The script reads data from an Excel sheet and adds new records to the table.Excel file and TestComplete project suite:<TestComplete Samples>ScriptsDDTDDT&NameMappi ng(數(shù)據(jù)驅(qū)動(dòng)測(cè)試,使用 NameMappi ng)Illustrates h

32、ow to perform data-drive n tests in TestComplete. See alsoData-Drive nTest ing . The script tests the OrdersDemo applicati on, which is used to con figure a table of purchase orders. The script adds new records to the table and modifies existi ng on es. The data the script en ters to table records a

33、re take n from differe nt sources: a multidime nsional array defi ned directly in the script, a comma-separated values (CSV) file that the script accesses via Scripti ng.FileSystemObject, a CSV file that the script accesses via ADO, a Microsoft Access database that the script accesses via ADO and an

34、 Excel file that the script accesses via ADO. In order to unify the testi ng of the Ian guage-specific impleme ntati ons of the OrdersDemo applicatio n (there are vers ions writte n in Microsoft Visual C+, Microsoft Visual Basic, Borla nd Delphi and Borla nd C+Builder), the script uses custom object

35、 n ames. SeeNameMapping .Data:<TestComplete Samples>ScriptsDDT&NameMapp in gDataTestComplete project suite:<TestComplete Samples>ScriptsDDT&NameMappi ngTestComplete 數(shù)據(jù)驅(qū)動(dòng)測(cè)試的視頻: n-testi ng-testcomplete-webi nar/如何在TestComplete 的關(guān)鍵字視圖中使用DDT實(shí)現(xiàn)數(shù)據(jù)驅(qū)動(dòng)?(視頻)Data Driven Test ing in Keyword

36、Testi ng Driven Testi ng in Keyword Test ing .aspx如何在TestComplete 中使用CSV文件進(jìn)行數(shù)據(jù)驅(qū)動(dòng)測(cè)試?(視頻):Data Drive n Testi ng With CSV files Drive n Testi ng With CSV files.aspx 如何在TestComplete中使用數(shù)據(jù)庫(kù)表進(jìn)行數(shù)據(jù)驅(qū)動(dòng)測(cè)試?(視頻):Data Driven Test ing With database Tables Drive n Testi ng With database Tabl es.aspx軟件自動(dòng)化測(cè)試成功之道讀書筆記(8

37、)學(xué)習(xí)軟件自動(dòng)化測(cè)試成功之道附帶光盤中的TestComplete基礎(chǔ)教程:21事件處理(1).swf22事件處理(2).swfTC的事件處理機(jī)制類似于 QTP的場(chǎng)景恢復(fù)機(jī)制,一般用于處理非預(yù)期異常事件、 出窗口。非預(yù)期彈TC中可處理的一般事件包括:On LogCloseNode On LogCreateNodeOccurs when a log folder is pop off the log.Occurs whe n a new log folder is appe nded on the log.On LogErrorOccurswhe n an error message is pos

38、ted to the log.On LogEve ntOccurs whe n an event message is posted to the log.On LogFileOn LogL inkOn LogMessageOn LogPictureOn LogWar ningOccurs whe n a file is posted to the log.Occurs when a file reference (link) is posted to the log.Occurs when a information message is posted to the log.Occurs whe n a picture (image) is posted to the log.Occurs whe n a warning message is posted to the log.OnOverlappingWindow Occurs when a overlapping window appears.On TimeoutOccurs whe n a timeout expires in a project or project suite.OnUnexpectedWindow Occurs when an unex

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論