Expain about data driven testing using silktest
Submitted by: Administrator1) Create an .xls containing the data required in the script such as username and password for this example
2) In Silk select Workflow -> Data Driven
3) Select Data Driven Test Case (after you create your testcase) Following the wizard browsing to the .xls file containing your data when prompted. This creates the DSN automatically for you. Accept rest of defaults barring you required naming conventions
4) In you script then code your method as say for example:
[CODE]
testcase DataDrivenExample () appstate DefaultBaseState
[ ]
[ ] Browser.Maximize()
[ ]
[ ] // If the Logon page is not displayed Load it.
[-] if (!LoginPage.Exists())
[ ] Browser.LoadPage("{kProtocol}://{kWebServer}:{kPort}/logon.jsp")
[ ]
[ ] LoginPage.LoginUser (User, Password)
[ ] ApplicationHome.Exists(kPageTimeOut)
[ ] ApplicationHome.SetActive()
[CODE}
Now highlight your variable User say first and from the column drop down list on the replace pan select your UserName column(that is been linked to your spreadsheet, this is all automatically done) and select Replace button, do the same for the rest of your required data. Notice the DATA DRIVEN ASSISTANT SECTION is automatically generatign code. This is a good way to start off anyways, hope it's been of some help, simple xls sheet attached but only expremely basic one
Below is what Code migth look like after Replace is selcted
[CODE]
testcase DataDrivenExample (REC_DATALIST_DD_DataDrivenExample rData) appstate DefaultBaseState
[ ]
[ ] Browser.Maximize()
[ ]
[ ] // If the Logon page is not displayed Load it.
[-] if (!LoginPage.Exists())
[ ] Browser.LoadPage("{kProtocol}://{kWebServer}:{kPort/logon.jsp")
[ ]
[ ] LoginPage.LoginUser (rData.recSheet1_.User, rData.recSheet1_.Password)
[ ] ApplicationHome.Exists(kPageTimeOut)
[ ] ApplicationHome.SetActive()
[CODE]
Submitted by: Administrator
2) In Silk select Workflow -> Data Driven
3) Select Data Driven Test Case (after you create your testcase) Following the wizard browsing to the .xls file containing your data when prompted. This creates the DSN automatically for you. Accept rest of defaults barring you required naming conventions
4) In you script then code your method as say for example:
[CODE]
testcase DataDrivenExample () appstate DefaultBaseState
[ ]
[ ] Browser.Maximize()
[ ]
[ ] // If the Logon page is not displayed Load it.
[-] if (!LoginPage.Exists())
[ ] Browser.LoadPage("{kProtocol}://{kWebServer}:{kPort}/logon.jsp")
[ ]
[ ] LoginPage.LoginUser (User, Password)
[ ] ApplicationHome.Exists(kPageTimeOut)
[ ] ApplicationHome.SetActive()
[CODE}
Now highlight your variable User say first and from the column drop down list on the replace pan select your UserName column(that is been linked to your spreadsheet, this is all automatically done) and select Replace button, do the same for the rest of your required data. Notice the DATA DRIVEN ASSISTANT SECTION is automatically generatign code. This is a good way to start off anyways, hope it's been of some help, simple xls sheet attached but only expremely basic one
Below is what Code migth look like after Replace is selcted
[CODE]
testcase DataDrivenExample (REC_DATALIST_DD_DataDrivenExample rData) appstate DefaultBaseState
[ ]
[ ] Browser.Maximize()
[ ]
[ ] // If the Logon page is not displayed Load it.
[-] if (!LoginPage.Exists())
[ ] Browser.LoadPage("{kProtocol}://{kWebServer}:{kPort/logon.jsp")
[ ]
[ ] LoginPage.LoginUser (rData.recSheet1_.User, rData.recSheet1_.Password)
[ ] ApplicationHome.Exists(kPageTimeOut)
[ ] ApplicationHome.SetActive()
[CODE]
Submitted by: Administrator
Read Online SilkTest Job Interview Questions And Answers
Top SilkTest Questions
☺ | How to search for html link? |
☺ | How to read .xls file contents without using the ddt wizard? |
☺ | Need help regd. silk test runing thr .bat file on cmd prompt? |
☺ | How to launch 2 web application windows simultaneously thru Silktest? |
☺ | Can SilkTest run on Mac? |
Top Application Program Categories
☺ | AutoCAD Interview Questions. |
☺ | Microsoft Office Interview Questions. |
☺ | Microsoft Outlook Interview Questions. |
☺ | Microsoft Excel Interview Questions. |
☺ | MATLAB Interview Questions. |