19. close( ) - predefined method to close the Test Browser window



close( ) predefined method of 'Selenium' Class is used to close the test browser window.

Example: object1.close( );

Lets Implement This:


1. Start the Selenium RC Driver as explained in our previous Post#14
2. Open the URL using the Selenium RC command as explained in our previous Post#15
3. Maximize the browser window having the opened URL using the Selenium RC command as explained in our previous Post#16
4. Re-size the browser window maximized in the previous step as explained in Post#18
5. Add a Thread.sleep(3000) to pause the execution for 3 seconds before closing as shown below:


6. Close the Test Browser window by writing close( ) predefined method of 'Selenium' Class into the Selenium RC code as shown below:


7. Save and Run the Selenium RC code using JUnit and observe that the Test Browser window is closed as shown below:


Watch the below Video:

Click here to watch the video.

Download This Project

Click here to download the Project explained in this Post and import into Eclipse IDE on your machine.

Please comment below to feedback or ask questions.

Using stop( ) to close the Selenium RC Driver window will be explained in the next post.






No comments:

Post a Comment

Followers

Labels