Reference no: EM133673702
Software Quality and Testing
Task: Selenium drives chromium browser
Now that you have everything setup, we can start using Selenium to automate browser using
Java programming. In this task, you will use Selenium API to do several actions including starting the chromium browser, opening a URL, resizing it and finally closing it.
Submission details
For this task you will need to study the existing project task1_2P.zip which has SeleniumOperations.java file where you need to fill in the missing lines in the function open_chrome_loadpage_resize_close(). You must run Main.java file in Eclipse and capture the output.
Submit a pdf combining below items
A screenshot of your screen showing Eclipse IDE console output
A screenshot of your screen showing chromium browser opened by Selenium from your code
Your program's source code (SeleniumOperations.java)
A screenshot of your github page where your latest project folder is pushed.
You want to focus on the following key ideas, and make sure you can explain them in relation to your program.
Java programming (main function, static keyword)
Selenium automates browsers (Selenium API calls w.r.t. webdriver).
Instructions
For this task you will need to
Download task1_2P.zip Java project and unzip it in a common folder (say, java_projects) which you will be using to store all the weekly projects.
Import the project (as a maven project) in Eclipse IDE
Observe different functions by altering the choice variable in Main.java and run Main.java file. For instance, choice = 1 activates case 1 which is SeleniumOperations.open_chorme_and_close() function defined in the SeleniumOperations.java file which opens chrome browser, waits a while and closes it.
You can observe the behaviors of case 1, 2 and 3. Your task is to complete the case 4 function open_change_loadpage_resize_close(), shown below in red color text. Once done, you have to run the Main.java file with choice set to 4, capture Eclipse IDE's console output and the Selenium controlled chromium browser.
Upload your folder to your github account and take a screenshot. Find instructions in the unit site on how to create a new empty project (say, task1_2P_<studentID>) in github and upload your Eclipse Maven project with the same name in the newly created github empty project.
Your Task
Study three functions in the SeleniumOperations.java and complete the 4th function open_chrome_loadpage_resize_close(). Follow the instructions in the function definition in the java file.
Modify the Hello message at the beginning of the function with your student ID and full name.
Resize the chromium browser window size using Selenium API to 640x480 and sleep for 2 seconds.
Resize the chromium browser window to double the previous step to 1280x960 and sleep for 2 seconds.
Run the Main.java with choice=4 and test your program works.