190 likes | 328 Views
Automated Web Page Testing with Selenium IDE: . An Overview Mary Ann May-Pumphrey 11/20/08. What is Selenium IDE?. An open-source tool for building automated test suites of web pages Named for the antidote for Mercury poisoning (Mercury Interactive created WinRunner)
E N D
Automated Web Page Testing with Selenium IDE: An Overview Mary Ann May-Pumphrey 11/20/08
What is Selenium IDE? • An open-source tool for building automated test suites of web pages • Named for the antidote for Mercury poisoning (Mercury Interactive created WinRunner) • Implemented as an extension to Firefox
Installation of SIDE • Point browser at Selenium IDE installation page on OpenQA web site. • Select the download link for 1.0 Beta 1. • If nothing happens, then select the Edit Options button just above the page. Then select the Allow button on the Allowed Sites pop-up, followed by the Close button.
Installation of SIDE • Select the download link for 1.0 Beta 1 again. • Select the Install Now button of the Software Installation window. • Select the Restart Firefox button of the Add-ons window.
Bringing Up SIDE Firefox => Tools => Selenium IDE
Example: Link-Checking • Point Firefox browser at SUT, De Anza A-Z Directory. • Select File=>New Test Case. • Click on the red Record button to start recording if needed (it is already on by default when Selenium IDE is first brought up).
Example: Link-Checking • Click on browser window to give it focus. • Click on letter T from alphabetical horizontal navigation bar. • Select Technical Writing link, and wait for new page to load.
Example: Link-Checking • Bring up context menu. • Right-click for right-handed Windows users. • Left-click for left-handed Windows users. • CTRL-click for Mac users. • Select Verify Title Technical Writing from context menu. • Select browser's Back button.
Example: Link-Checking • Repeat the last four steps for the Transcripts link. • Click the red Record button to stop recording. • At this point, all of the user actions except the clicks on the Back button have recorded. To take care of these clicks, we will add calls to the goBackAndWait function.
Inserting Selenese Function Calls from Table view • Select Table tab of Selenium IDE. • Select second clickAndWait. • Bring up the context menu of IDE and select Insert New Command. • Type "g" into Command field. • Select goBackAndWait from command menu.
Replaying a Test • Select File=>Save As to save the test. • Drag the speed slider to Slow. • Select the green right-pointing arrow (Play from the beginning or start point).
Analyzing the Results • From Table view, observe the green vs. red shading on assertions. • From Table or Source view, select the Log tab and look for errors (bold red font).
Test Case for De Anza’s Search Center Word+quoted phrase search of entire site
Test Case for De Anza’s Search Center:Actions • Enter pass "no pass" (including double quotes) into the textarea just below ...search the entire De Anza Web site. • Select the Search button.
Test Case for De Anza’s Search Center:Expected Results • The browser title should be Search Results: pass "no pass". • The phrase Searched for pass "no pass" string should appear on the page. • The phrase Results of 1 - 10 of about should appear on the page. • The textarea above the search results should contain the original search string, including quotes. • Each of the 10 resulting snippets should include the word pass and the phrase no pass, although the punctuation and spacing may vary.
Test Case for De Anza’s Search Center:The Test Case Code Note: • The use of comments (displayed in purple) • The while loop, which requires the installation of an extension to SIDE
CIS Course on SIDE • CIS-200W-01L Topics in Computer Information Systems: Automated Web Page Testing with Selenium IDE • Winter Quarter 2009: Saturdays, 1:00 - 4:30 (10 sessions) • 2 units (1 hour lecture, 3 hours laboratory)