Top Banner
VooDooDriver ( Testing Framework)
31
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Voo doodriver training

VooDooDriver ( Testing Framework)

Page 2: Voo doodriver training

Agenda of Training

Introduction of VooDooDriver. How to setup VooDooDriver. VooDooDriver demo script. How to execute VooDooDriver. VooDooDriver Elements. Data Driven using CSV. Test Scenarios and Test Cases VooDooDriver Log.

Page 3: Voo doodriver training

Introduction of VooDooDriver

Automation Framework Coded in Java Based on Selenium WebDriver Replacement for SODA testing framework Test script in xml format

Page 4: Voo doodriver training

Advantages of VooDoo over Selenium

No need to write code for initializing browser. No need to write code for reading input file. No need to write code for handling pop up

window. Facilitates to use simple tag elements to use

web elements in your test script. No need to use action builder for advanced

user interactions.

Page 5: Voo doodriver training

Challenges

To write to a file using XML.Does not generate interactive report just like

TestNG report. Conditions and looping doesn’t work in XML.

Page 6: Voo doodriver training

How to setup VooDooDriver?

Open url: https://github.com/sugarcrm/VooDooDriver/

Download the code. Open eclipse. Create a Project with name "Voodoo". Import the code under the created project

"Voodoo".

Page 7: Voo doodriver training

VooDoo Demo Script

<soda><link id="moduleTab_Accounts"

jscriptevent="onmouseover" click="false"/><link id="Accounts_link" click="true"/><textfield id="name_basic" set="Adams" /><button id="search_form_submit" click="true"/></soda>

Page 8: Voo doodriver training

How to execute VooDoo script? Go to src->VoodooDriver.java. Right click -> Run As -> Run Configuration. Select tab "Arguments". Input the command line arguments --

browser=firefox -- suite=C:\Users\Sanjeev\workspace\voodoo\tests\suites\VooDooTest.xml.

--browser=firefox -- suite=C:\Users\Sanjeev\ workspace\voodoo\tests\suites\VooDooTest.xml.

Page 9: Voo doodriver training

VooDooDriver Elements

1. Attach 2. Variable3. Wait4. Puts5. Browser6. TextField7. TextArea8. Label

Page 10: Voo doodriver training

VooDooDriver Elements

9. Button10.Unordered List (UL)11. Select12. Radio13. Checkbox14. Frame15. Div16. Link

Page 11: Voo doodriver training

VooDooDriver Elements

17. Span18. Assert19. Jscriptevent20. Alert21. Screenshot

Page 12: Voo doodriver training

VooDooDriver Elements

Attach

<attach title="The new Window">//attach that new window

<button id="save" /><browser action="close" /> //close the

popup browser</attach>

Page 13: Voo doodriver training

VooDooDriver Elements

Variable

<var var="test" set="123" /> //create a variable ‘test’ and set it to 123

<textfield id="foo" set="{@test}" /> //set value of test to the text field

Page 14: Voo doodriver training

VooDooDriver Elements

Wait

<wait /> //wait for a period of 5 seconds<wait timeout = “2” /> //wait for a period of 2 seconds

Puts

<puts text=”Hello World” /> // print the text “Hello World”

Page 15: Voo doodriver training

VooDooDriver Elements

Browser

<browser url="http://cnn.com" /> //browse to CNN.com

<browser assert="Lastest News" /> //make sure ‘Latest News’ shows up on page

<browser action="close" /> //closes the browser

Page 16: Voo doodriver training

VooDooDriver Elements

TextField

<textfield id="foo" set="tree“ /> /* sets the value of the text field to ‘tree’ */

Page 17: Voo doodriver training

VooDooDriver Elements

TextArea

<textarea id="foo" set="this can be a very long string" />

/* sets the value of the textarea to ‘this can be a very long string’ */

Page 18: Voo doodriver training

VooDooDriver Elements

Unordered List (UL)

<UL name=”user_select” click=”true” />/* looks for the Unordered List by the name and

then clicks on it */

Page 19: Voo doodriver training

VooDooDriver Elements

Select

<select id="sel" set="1" /><select id="sel" set="9" />/* selects two options in the HTML select

element*/

Page 20: Voo doodriver training

VooDooDriver Elements

Checkbox

<checkbox name="massall" click="true" />/* the checkbox with name ‘massall’ will be

checked */

Page 21: Voo doodriver training

VooDooDriver Elements

Frame

<Frame name=“xframe“ />/* the Frame with name ‘xframe’ is called*/

Page 22: Voo doodriver training

VooDooDriver Elements

Div<div id="list_div_win"> //focus on

the ‘list_div_win’ section of the page<button value="Add" click="true" />//click the

button in the page section</div>/* goes to the div field ‘list_div_win’ and clicks

the button ‘Add’ and the performs an ‘onmouseup’ event for the button */

Page 23: Voo doodriver training

VooDooDriver Elements

Span

<span class="pageNumbers" assert="(1 - 2 of 6)" />

/* asserts that class ‘pageNumbers’ has the text ‘1-2 of 6’ */

Page 24: Voo doodriver training

VooDooDriver Elements

jscriptevent

<button value="Add" jscriptevent="onmouseup" />//onmouseup event for add button

Page 25: Voo doodriver training

VooDooDriver Elements

Alert

<alert alert="true" assert="Your registration will now be submitted, do you wish to proceed?"/>

Page 26: Voo doodriver training

VooDooDriver Elements

Screenshot

<screenshot file="C:\Users\Sanjeev\Desktop\screen\a1.png"/>

Page 27: Voo doodriver training

Data Driven using CSV

<csv file="C:/scripts/sugarcrm/csvs/users.csv var="user" />

<puts text="{@user.username}" /></csv>

Page 28: Voo doodriver training

Test Scenarios and Test Cases

You can create script for multiple test cases under tests folder.

You can create Test Scenario in the form of test suites that will contain the set of test cases which will contain under tests->suites.

Page 29: Voo doodriver training

VooDooDriver Log

After running your script the test report generates in the form of log file.

Soda Test Report:--testlog:C:\Users\Sanjeev\workspace\Crmdev\06-19-2013-12-38-02.588\CheckCreateLeave-06-19-2013-12-38-08-331.log

Select the path of the testlog and view it on another window.

Page 30: Voo doodriver training

Questions??

Page 31: Voo doodriver training

Thank You.