Automation Engineer Hands on Assignment - Selenium
Automation Engineer Hands on Assignment - Selenium
Engineer)
Selenium
Version: 1.1
Status: Final
Document Internal
Classification:
Page 1 of 40
Contents
Overall Process overview...........................................................................................................................3
Step 1 - Get access to VPN..........................................................................................................................4
Step 2a - Connecting to VPN.......................................................................................................................4
Step 2b - Accessing RDP training page.......................................................................................................5
Step 3 – Proceed for script development...................................................................................................7
Step 4 - Launch Eclipse from RDP page......................................................................................................7
Step 5 - Create a Workspace.....................................................................................................................11
Step 6 - Create a new Project...................................................................................................................12
Step 7 - Create a new Class.......................................................................................................................15
Step 8 - Download Selenium WebDriver jar.............................................................................................17
Step 9 - Add Jars to Java build path..........................................................................................................19
Step 10 - Develop a sample script............................................................................................................22
Step 11 - Execute a sample script.............................................................................................................30
Step 12 - Develop scripts as per case study sheet....................................................................................35
Step 13 - Execute your test.......................................................................................................................35
Step 14 - Save your results........................................................................................................................35
Evaluation process....................................................................................................................................38
Technical Issue Management...................................................................................................................39
Troubleshooting........................................................................................................................................41
Page 2 of 40
Overall Process overview
The overall process to complete the hands on assignment is given below.
Page 3 of 40
Step 1 - Get access to VPN
It is important to have access to the training environment. The environment allows a user to access
various tools required to complete the assignment.
*Note: You must be connected to VPN in order to access automation tools and ALM.
Page 4 of 40
Step 2b - Accessing RDP training page
1. Make sure that you have added VPN and training URL in trusted sites
2. Launch Internet Explorer and connect to: https://hpapptraining.accenture.com – this will take you
to the login page
3. Enter your Accenture Enterprise ID in the “Domain\user name” field and your password in the
“Password” field and click on Sign In
a. Be sure that if you are using a public or shared computer that you select the option for “This
is a public or shared computer”.
Page 5 of 40
4. Once you log in, you will see the RemoteApp and Desktops page which will have training
applications, links and folders published.
Page 6 of 40
Step 3 – Proceed for script development
If you are developing the script using Eclipse, go to step 4
2. You will receive a popup that verifies that you wish connect to the application/link. Ignore the
statement about the publisher not being identified
a. Click “Connect”
Page 7 of 40
3. You will be prompted for your Accenture Enterprise ID and Password – enter it and click “OK”
Page 8 of 40
4. The Eclipse is starting…..
Page 9 of 40
Click Yes
Click on Run
Page 10 of 40
Step 5 - Create a Workspace
Please follow below steps:
*Note: Please make it sure to take backup of your work in MyDocument folder. Please check advise from
server tech support team regarding same:
Only data copied to your personal profile will “roam” with the user. Data stored in any other location
will only be accessible from the terminal server which you were on and it cannot ever guarantee what
system to which you will connect next time.
Page 11 of 40
2. You may see the window like this, this is the Welcome window for Eclipse.
1. Create new Java Project from File > New > Java Project.
2. Give your Project name ‘SeleniumProject‘ as shown in below given figures. Click on Finish
button.
Page 12 of 40
3. You may or may not see this message but if in case you get any, check Remember my
decision and click on Yes.
Page 13 of 40
Now your new created project ‘SeleniumProject‘ will display in eclipse project explorer.
Page 14 of 40
Now you can see a new package with name ‘selenium‘ under project name ‘SeleniumProject‘.
2. Give your Class name ‘FirstTestCase‘, check the option ‘public static void main‘ and click on Finish
button. This will bring up totally a sweet class creation window.
Page 15 of 40
Note: In case of not creating class for Main test case, please do not click ‘public static void main’. We
need to select it only in case of writing test cases which we are going to execute and from where we
call other classes. For functional classes, POM classes or any other classes we don’t need this to be
checked.
3. Now your Eclipse window will looks like below.
Page 16 of 40
For Firefox version 47,
Page 17 of 40
1. Download selenium-server-standalone-2.52.0.jar from http://selenium-
release.storage.googleapis.com/index.html?path=2.52/ or http://docs.seleniumhq.org/download/
click on Previous Releases in left menu and select 2.52.
Page 18 of 40
For Firefox version 47, copy selenium-server-standalone-2.53.0.jar and sac-1.3.jar in jars folder
Page 19 of 40
3. Click OK.
Page 20 of 40
5. Now you are ready to write your test script in eclipse and run it in WebDriver.
Page 21 of 40
Step 10 - Develop a sample script
Sample script is to do a google search to get more details on Selenium.
If Selenium IDE icon is not displayed on the menu bar, open Firefox -> Tools menu, select Selenium
IDE and click on Customize
Now drag Selenium IDE from Additional Tools and Features window and drop it before Firebug icon
(last icon in below screenshot) in menu bar.
Page 22 of 40
Click on Exit Customize button at bottom of window
Page 23 of 40
Now Selenium IDE will be displayed in menu bar.
Set the Base URL as https://www.google.com/ and click on Red circle to record. Select the empty area
under Command, Target, Value grid and start recording.
Page 24 of 40
Enter Selenium in search box and you will see commands getting recorded in IDE.
Page 25 of 40
Search for Fire Bug in Add-ons Manager window and install it
Page 26 of 40
Hover on the search box and right click. You will get an option to Inspect in FirePath. Capture the
xpath of search box and use for automation.
Page 27 of 40
4. Using Java program
Capture the xpaths of required elements of web page and create a Java program to automate the
required scenario.
Go to Eclipse workspace and open the FirstTestCase class that we created in step 7.
For Firefox version <47,
Add following code in FirstTestCase between public class FirstTestCase {
}
Save file
Page 28 of 40
driver.get(baseUrl + "/?");
//open google.com
driver.findElement(By.id("lst-ib")).clear();
//search Selenium
driver.findElement(By.id("lst-ib")).sendKeys("Selenium");
System.out.println("Entered Selenium");
driver.findElement(By.name("btnG")).click();
System.out.println("Searched Selenium");
}
catch (Exception exception) {
exception.printStackTrace();
}
finally {
//close browser
driver.close();
System.out.println("Closed Firefox browser");
}
}
Class should look like
For Firefox 47
Page 29 of 40
String currentDir = System.getProperty("user.dir");
System.setProperty("webdriver.gecko.driver", marionetteDriverLocation);
Page 30 of 40
o Export the test case as JUnit Test Case selecting File -> Export Test Case As -> Java /
JUnit4 / WebDriver. Save the file in C:\SeleniumWorkspace\SeleniumProject\src\
selenium.
Page 31 of 40
Refresh eclipse project and you should see GoogleSearch program
As we copied file from IDE, the package name is different and is displayed as an error in the 1 st line
of GoogleSearch program. Change package name as Selenium as Save.
Page 32 of 40
Execute the test clicking on Run button. Firefox browser gets opened and performs the google
Selenium search automatically.
Page 33 of 40
2. Using Java
o Execute the test clicking on Run button. Firefox browser gets opened and performs the
google Selenium search automatically.
Page 34 of 40
Step 12 - Develop scripts as per case
study sheet
1. Go through the case study attached below:
2. Read both the case studies along with general information, throughly.
3. Once ready, start the script development using Selenium IDE or Eclipse.
4. Create a folder with name Firstname_EmpID under C:\MultiSkilling_Selenium.
5. Save case study related test scripts in CaseStudyX_TestScripts folder.
Note: Replace X in CaseStudyX with Case Study number.
Go to Log tab at the bottom of Selenium IDE, select all highlighted text under Log tab and copy
the execution result to to CaseStudyX_Result_TimeStamp.txt
Page 35 of 40
2. Using Java
Save the execution result to to CaseStudyX_Result_TimeStamp.txt
Aftere completion of execution, upload results file and other artifacts to Issue Resolution tool
https://ts.accenture.com/sites/JavaCapability/Javaupskill/_layouts/15/start.aspx#/SitePages/
Home.aspx.
Page 36 of 40
2. Populate below values:
Page 37 of 40
Evaluation process
After successfully completing both the case studies, this will be considered for evaluation.
Evaluation will be based on Quality of coding, Implementation of steps as mentioned in case study
document and execution results
o Code Quality
o Coding Standards
o Implementation of
verification points
o Overall execution result o Data driven
o Effectiveness of custom o Error handling
messages
o Screen shots Test Scripts
o Verification result steps
Execution
Results
Final
Outcome
Page 38 of 40
Technical Issue Management
Please follow below process in case you face any technical issue related to the assignment.
https://go.accenture.com/multiskilling
2. Click on “Raise new request” button
3. Fill Issue category as “” Hands on assignment” and all other mandatory fields and submit it
Page 39 of 40
5. Check FAQs document available on the portal for further details
Troubleshooting
Please use below documents that provide details of the issues you may face while working on the
assignment. The document covers the issues/information related to:
1. VPN
2. Tool
3. Other generic details
Page 40 of 40