Selenium tutorial
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Selenium tutorial

on

  • 297 views

Selenium for beginners

Selenium for beginners

Statistics

Views

Total Views
297
Views on SlideShare
297
Embed Views
0

Actions

Likes
1
Downloads
9
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Selenium tutorial Presentation Transcript

  • 1. Selenium Tutorial www.mindqonline.com
  • 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 www.mindqonline.com
  • 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/ www.mindqonline.com
  • 4. Selenium IDE The root of web application you want to test The list of actions in the actual test case to execute The log of the events that were executed, including any errors or warning that may have occurred www.mindqonline.com
  • 5. Selenium IDE Execution Commands Try the test in the Web based TestRunner Reference of the currently selected command Record test actions Specify commands, includin g asserts www.mindqonline.com
  • 6. Test Creation Demo • Create test case to log into the gallery • Create test case to log out of the gallery www.mindqonline.com
  • 7. Start Pixory Connect to the Server Go to the Login Screen Hit the Record Button www.mindqonline.com
  • 8. Type in Username and Password IDE should update Hit submit Hit record again to stop www.mindqonline.com
  • 9. Add assertTextPresent and type the text to search for Hit play to make sure your test is successful www.mindqonline.com
  • 10. Creating a Test Suite • A Test Suite in Selenium is just an HTML file that contains a table of links to tests <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> <title>Demo Test Suite</title> </head> <body> <table id="suiteTable"> <tbody> <tr><td> <b>Demo Test Suite</b> </td></tr> <tr><td> <a href="./testLogin.html">TestLogin</a> </td></tr> <tr><td> <a href="./testLogout.html">TestLogout</a> </td></tr> </tbody> </table> </body> </html> www.mindqonline.com
  • 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 www.mindqonline.com
  • 12. Running the Test Suite • We basically want to execute the test suite using the Selenium IDE plug-in TestRunner.html chrome://selenium- ide/content/selenium/TestRunner.html?baseURL=<BASE>&tes t=file:///<TEST SUITE FILE>&auto=true chrome://selenium- ide/content/selenium/TestRunner.html?baseURL=http://loc alhost:8081&test=file:///Users/ms333/projects/classes/r unning/v_and_v/hw3/selenium/test/TestSuite.html&auto=tr ue www.mindqonline.com
  • 13. Test Suite www.mindqonline.com
  • 14. Test Suite Application being tested Test Cases Steps of the test case Execution Control www.mindqonline.com
  • 15. Test Runner Control www.mindqonline.com
  • 16. Test Runner Control Run All Tests Run Selected Test Pause/Play Execution Step through Execution Control Speed of Execution Highlight Elements in the Execution View the DOM of the current Page being tested Summary of the Test View the log of the current executionwww.mindqonline.com
  • 17. TestRunner Demo • Execute Tests created inside the Firefox TestRunner www.mindqonline.com