20. stop( ) - predefined method to close the Selenium RC Driver window





stop( ) predefined method of 'Selenium' Class is used to close the Selenium RC Driver window.

Example: object1.stop( );

Lets Implement This:

1. Continue adding the code to the Selenium RC Code in our previous Post#19
2. Add a Thread.sleep(3000) to pause the execution for 3 seconds before closing the Selenium RC Driver window as shown below: (We are writing this Thread.sleep( ) statement to make the execution slow. So that we can view the Automation script actions - In real time you should not write Thread.sleep( ) statements like this):


3. Create a method say 'tearDown( )' as shown below:


4. Specify the above created method with @After Junit Annotation as shown below: (So that the code written in this method will get executed after executing the code under the method specified with @Test Annotation):


5. Resolve the error with the @After annotation as explained in our previous old posts
6. Write stop( ) predefined method of 'Selenium' Class to close the Selenium RC Driver window as shown below:


7. Save and Run the Selenium RC code with the JUnit Test and observe that the Selenium RC Driver window gets close 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 click( ) method will be explained in the next post.



No comments:

Post a Comment

Followers

Labels