QATestLab                                                                      21, Garmatna str., Kiev, Ukraine           ...
QATestLab                                                  21, Garmatna str., Kiev, Ukraine                               ...
QATestLab                                                21, Garmatna str., Kiev, Ukraine                                 ...
QATestLab                                                   21, Garmatna str., Kiev, Ukraine                              ...
QATestLab                                                   21, Garmatna str., Kiev, Ukraine                              ...
Upcoming SlideShare
Loading in …5
×

QATestLab. Automated QA Test Complete Script Example

3,958 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,958
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
49
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

QATestLab. Automated QA Test Complete Script Example

  1. 1. QATestLab 21, Garmatna str., Kiev, Ukraine ph.: +380-44-4067024 http://qa-testlab.com/ contact@qa-testlab.comAutomated QA TestComplete Script ExampleThis script was developed by QATestlab team to test desktop .Net application using TestComplete(Automated QA).The script imports orders in *.txt format to desktop application and verifies behavior in differenttest situations.Sample Script for TestComplete//Import two identical files (orders)function Import_Identical_Order(){// p – process// w – window var p1; var w1,w2,w3,w4; var l1; var i=0; p1 = Sys.Process("ClientCatalog"); w1 = p1.MainForm; //Choose Electric tools in tree w1.WinFormsObject("panelTreeView").treeViewElements. ClickItem("|Catalogues| Electric tools|"); //Clear order with clear button Clear_Order(); (c) QATestLab, 2010 http://qa-testlab.com/
  2. 2. QATestLab 21, Garmatna str., Kiev, Ukraine ph.: +380-44-4067024 http://qa-testlab.com/ contact@qa-testlab.com w1.MainMenu.Click("Import Order");// Dialogue Windows var oOpenDlg = p1.Window("#32770", "Import Order from File”); if (!oOpenDlg.Exists) throw "Open dialog not found!"; oOpenDlg.Window("ComboBoxEx32", "", 1). Keys(Project.Path + "Filesorder.txt"); oOpenDlg.Window("Button", "&Open").ClickButton();// Wait order processing while (g2.gradIconicButtonForm.Enabled!=true)delay(100);w1.WinFormsObject("panelTreeView").treeViewElements.ClickItem("|Catalogues| Electric tools|");w2=w1.WinFormsObject("panelCBottom").WinFormsObject("CatalogsBottom").WinFormsObject("panelCatalogs");(c) QATestLab, 2010 http://qa-testlab.com/
  3. 3. QATestLab 21, Garmatna str., Kiev, Ukraine ph.: +380-44-4067024 http://qa-testlab.com/ contact@qa-testlab.com// verifyFind_Picture(w2, "Import_Correct_Order_001.jpg");// Repeat import - Cancel w1.MainMenu.Click("Import Order");// Dialogue Windows var oOpenDlg = p1.Window("#32770", "Import Order from File”); if (!oOpenDlg.Exists) throw "Open dialog not found!"; oOpenDlg.Window("ComboBoxEx32", "", 1). Keys(Project.Path + "Filesorder.txt") oOpenDlg.Window("Button", "&Open").ClickButton(); w3=p1.WaitWinFormsObject("ImportOrderConfirmation", 100000); if (w3.Exists) { l1=w3.WinFormsObject("labelText")(c) QATestLab, 2010 http://qa-testlab.com/
  4. 4. QATestLab 21, Garmatna str., Kiev, Ukraine ph.: +380-44-4067024 http://qa-testlab.com/ contact@qa-testlab.com if (l1.Text!="Current order contains goods.") Log.Error("Wrong message") //Cancel w3.WinFormsObject("gradIconicButtonCancel"). ClickButton(); } else Log.Error("Wrong message after import identical order"); if (w3.Exists) Log.Error("Error");// Repeat import – addition to order w1.MainMenu.Click("Import Order");// Dialogue Windows var oOpenDlg = p1.Window("#32770", "Import Order from File”); if (!oOpenDlg.Exists) throw "Open dialog not found!"; oOpenDlg.Window("ComboBoxEx32", "", 1). Keys(Project.Path + "Filesorder.txt") oOpenDlg.Window("Button", "&Open").ClickButton();(c) QATestLab, 2010 http://qa-testlab.com/
  5. 5. QATestLab 21, Garmatna str., Kiev, Ukraine ph.: +380-44-4067024 http://qa-testlab.com/ contact@qa-testlab.com w3=p1.WaitWinFormsObject("ImportOrderConfirmation", 100000); if (w3.Exists) { l1=w3.WinFormsObject("labelText") if (l1.Text!=" Current order contains goods.") Log.Error("Wrong message"); // addition to orderw3.WinFormsObject("gradIconicButtonAddOrder").ClickButton();w4=p1.WaitWinFormsObject("GradMessageBox", 100000); Log.Message("Test ‘Import two identical files (orders)’ finished");}(c) QATestLab, 2010 http://qa-testlab.com/

×