0
Selenium Tutorial
What is Selenium?• Javascript framework that runs in your web-  browser• Works anywhere Javascript is supported• Hooks for...
Where to get it?• You can use Selenium-Core and customize  everything• But it is easier to just get a Firefox plug-in  “Se...
Selenium IDEThe root of web       The list ofapplication you       actions in thewant to test          actual test case   ...
Selenium IDE                       Record test                       actionsExecutionCommands                     Try the ...
Test Creation Demo• Create test case to log into the gallery• Create test case to log out of the gallery
Start Pixory                             Connect to the ServerGo to the Login Screen     Hit the Record Button
Type in Username and Password     IDE should update                           Hit record                          again to...
Add assertTextPresent and     Hit play to make sure yourtype the text to search for        test is successful
Creating a Test Suite                      <html>                      <head>                      <meta content="text/htm...
Executing the Test Suite• Selenium Core is a collection of Javascript and  HTML with iFrames • Due to security concerns Co...
Running the Test Suite• We basically want to execute the test suite   using the Selenium IDE plug-in TestRunner.htmlchrome...
Test Suite
Test Suite   Execution                   ControlTest CasesSteps of thetest caseApplicationbeing tested
Test Runner Control
Test Runner Control                          Pause/Play                          Execution      Step through              ...
TestRunner Demo• Execute Tests created inside the Firefox  TestRunner
Upcoming SlideShare
Loading in...5
×

Selenium

1,266

Published on

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

No Downloads
Views
Total Views
1,266
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
48
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Transcript of "Selenium"

  1. 1. Selenium Tutorial
  2. 2. What is Selenium?• Javascript framework that runs in your web- browser• Works anywhere Javascript is supported• Hooks for many other languages • Java, Ruby, Python• Can simulate a user navigating through pages and then assert for specific marks on the pages• All you need to really know is HTML to start using it right away
  3. 3. Where to get it?• You can use Selenium-Core and customize everything• But it is easier to just get a Firefox plug-in “Selenium-IDE” that helps you “record” test cases• You can record how an app is being used and then play back those recordings followed by asserts• Get everything at: www.openqa.org/selenium/
  4. 4. Selenium IDEThe root of web The list ofapplication you actions in thewant to test actual test case to executeThe log of theevents that wereexecuted, includingany errors orwarning that mayhave occurred
  5. 5. Selenium IDE Record test actionsExecutionCommands Try the test in the Web based TestRunnerReference of thecurrently selectedcommand Specify commands, including asserts
  6. 6. Test Creation Demo• Create test case to log into the gallery• Create test case to log out of the gallery
  7. 7. Start Pixory Connect to the ServerGo to the Login Screen Hit the Record Button
  8. 8. Type in Username and Password IDE should update Hit record again to stop Hit submit
  9. 9. Add assertTextPresent and Hit play to make sure yourtype the text to search for test is successful
  10. 10. Creating a Test Suite <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">A Test Suite in <title>Demo Test Suite</title> </head>Selenium is just an <body>HTML file that <table id="suiteTable"> <tbody> <tr><td>contains a table of <b>Demo Test Suite</b> </td></tr>links to tests <tr><td> <a href="./testLogin.html">TestLogin</a> </td></tr> <tr><td> <a href="./testLogout.html">TestLogout</a> </td></tr> </tbody> </table> </body> </html>
  11. 11. Executing the Test Suite• Selenium Core is a collection of Javascript and HTML with iFrames • Due to security concerns Core must be deployed within the same server as the application being hosted • The simplest way to run Pixory is to just run the Java application and let it use its own server • Problems using Core with Pixory• Selenium IDE is a plug-in for Firefox and thus can go around these restrictions
  12. 12. Running the Test Suite• We basically want to execute the test suite using the Selenium IDE plug-in TestRunner.htmlchrome://selenium-ide/content/selenium/TestRunner.html?baseURL=<BASE>&test=file:///<TEST SUITE FILE>&auto=truechrome://selenium-ide/content/selenium/TestRunner.html?baseURL=http://localhost:8081&test=file:///Users/ms333/projects/classes/running/v_and_v/hw3/selenium/test/TestSuite.html&auto=true
  13. 13. Test Suite
  14. 14. Test Suite Execution ControlTest CasesSteps of thetest caseApplicationbeing tested
  15. 15. Test Runner Control
  16. 16. Test Runner Control Pause/Play Execution Step through Execution Run Selected Test Control SpeedRun All Tests of Execution Highlight Elements in the Summary of Execution the Test View the DOM View the log of of the current the current Page being tested execution
  17. 17. TestRunner Demo• Execute Tests created inside the Firefox TestRunner
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×