Base URL is the URL which is provided in Selenium Automation while creating an object for Selenium Class.
Selenium object1 = new DefaultSelenium("localhost", 4444, "*firefox", "Base URL");
Example:
Selenium object1 = new DefaultSelenium("localhost", 4444, "*firefox", "http://book.theautomatedtester.co.uk/chapter1");
So we've provided http://book.theautomatedtester.co.uk/chapter1 as Base URL.
What is the Home Page of the above Base URL ?
If we clearly observe the http://book.theautomatedtester.co.uk/chapter1 BASE URL, its very clear that the User is in the 'chpater1' page of the http://book.theautomatedtester.co.uk Home Page URL. So http://book.theautomatedtester.co.uk is the Home Page of the above BASE URL.
In Selenium RC Automation, we can navigate to the Home Page URL from the Provided Base URL or any other page of the Home Page URL using the open( ) method as shown below:
object1.open("/");
Lets Implement This:
Pre-requisites:
1. Create a new Project say 'RC-Project7' in Eclipse IDE
2. Configure the Project to work with Selenium RC
3. Configure the Selenium Standalone Server to run from Eclipse IDE
4. Start the Selenium Standalone Server
5. Create a package say 'package_seven' under the newly created project.
6. Create a Java Class file say 'Class7' under the newly created package as shown below:
Actual Steps:
1. Write the following code into the newly created Java Class file as shown below and make sure that you resolve all the errors before going to next step:
2. Start the Selenium Standalone Server
3. Save and Run the 'Class7.java' file by selecting the 'JUnit Test' option and ensure that 'Home' page of the provided Base URL is displayed as shown below:
Watch the below video:
Click here to watch the video.
Download this Project:
Click here to download this project and import into Eclipse IDE on your machine.
Please comment below to feedback or ask questions.
Using open( ) method to open the Home page of the provided URL will be explained in the next post.
No comments:
Post a Comment