Title: Lab 6
Course: Special Topics in Computer Programming (TEMPLATE) > Section: Competency Modules

Check schedule for due date

Objective:

In this lab you will use Selenium IDE to create a test script that you will execute in Selenium, then convert the test script to Python and finally execute an edited version of the Python script..

Steps for success:

1.  Open the Firefox browser and click on the Selenium IDE icon.  Resize your windows so that you have Firefox on the right hand side of your screen and Selenium IDE on the left hand side of your screen (similar to what was shown in the video).

2.  Open www.austincc.edu/wtucker on the Firefox window (right hand side).  You are going to navigate through this website and Selenium will record all of the activity.

3.  Copy the URL from your Firefox window on the right hand side into the “Base URL” field on the Selenium IDE window (left hand side).

4.  Click on the RED record button on the Selenium window (left hand side) and proceed to browse and navigate with Firefox on the selected web site (right hand side).  (NOTE:  Please adjust the speed setting with the sliding button to the left of the green arrows to the slowest speed possible).   The required navigation is to first click on ITSE 1392, then the synonym for your specific section. At this point you will see the syllabus for your course.

5.  When you have finished browsing, click the RED button on the Selenium window to STOP recording.   Then on the left hand side, click on “File” then “Save Test Case As” and name your file as “yourlastnameLab6.html”

6.  Now click on the “Play Current Test Case” (second green arrow on the top of the Selenium IDE window).  If it plays too fast, you can adjust the speed with the sliding button to the left of the green arrows.

7.  Once the Selenium test case is running successfully, you need to export the test case as a Python program.  (Click on “File”, “Export Test Case As”, “Python 2 / unittest / Web Driver”)

8.  Make the following modifications to the generated code:

CHANGE  except NoSuchElementException, e: return False

TO          except NoSuchElementException as e: return False

CHANGE  except NoAlertPresentException, e: return False

TO          except NoAlertPresentException as e: return False

9.  Now verify that executing your Python module using IDLE and “Run Module” produces the same result as step 5.  NOTE:  If you get an error, it is most likely caused by the folder structure and can be fixed by changing the following statement in the Python code

change   driver.get(self.base_url + “/wtucker/”)     to     driver.get(self.base_url)

10. You are now going to modify the Python script to navigate to a different course and section.  Change the course to ITSE 1391 - Special Topics - Fundamentals of Software Testing and change the section to Synonym 37022 .

11. Finally execute the modified Python Script and you should see a syllabus for ITSE 1391 Fundamentals of Software Testing.  If the script runs TOO fast, you can slow it down by entering the followng command in the Python code time.sleep(x), where "x" is the number of seconds to delay.

12. When you have finished this lab, please submit both your Selenium and Python scripting files and a test summary report.