• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

How to Synchronize Selenium

Synchronization:

2Providing wait to the tool is known as synchronization. It is to maintain in synch between application &tool

2It is two types

1)page load

2)page refresh

1) Page load:-If the application is taking time to load the page then use the command

2Advantages of above command is, it doesn’t wait up to the given time .whenever the page load is completed ,it contains the execution. the given time is the maximum time to wait .

2) Page refresh:-

2if the application is taking time to refresh the page then use the below command

Thread.sleep(5000);  //5secs

2It is a standard wait .It is simply wait upto the given time.

2When ever we use thread. Sleep add throws. Exception to method &main method became it’s a java command . some of the java commands will throw exception  to handle it use throws exception.

2Write a program to register into mail.in.com by using methods?

Interested in mastering Selenium Training? Enroll now for FREE demo on Selenium Training Courses.

Note:-when ever the application is taking time either for page load or page refresh use selenium. Wait for page load command ,if it is throwing exception like timeout then change the wait forpageload command to thread.sleep() command.

Assignments:-

1) Write a program to test login functionality gmail,facebook&yahoo.com

2) Complete the mail registration scenario?

2Write a program to click on links like Hindi, Bengali, Telugu in google.co.in

2Write a program to click on links like Hindi, Bengali, Telugu by passing parameter  to the method.

Check out the top Selenium Interview Questions now!

Prog:- 

Package selenium rc;

Import com.throughworth.selenium.defaultselenium;

Public class googlelanguages-parameter{

Public defaultselenium selenium = new defaultselenium(“localhost”,1234,”firefox”,”//http:”)

Public void open url(){

Selenium.start();

Selenium.open();

Selenium.windowmaximize();

}

Public void clicklanguages(string str){

Selenium.click(“link=”+str);

Selenium.waitforpage to load(“3000”);

Selenium.click(“link=English”);

}

Public static void main(string[] args){

Googlelanguages-parameter g=new googlelanguages-parameter();

g.open url();

g.click language(“hindi”);

g.click language(“Bengali”);

g.click language(“telugu”);

}

For an Indepth knowledge on Selenium, click on below

Summary
Review Date
Reviewed Item
How to Synchronize Selenium
Author Rating
4

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on How to Synchronize Selenium"

    Leave a Message

    Your email address will not be published. Required fields are marked *

    Site Disclaimer, Copyright © 2016 - All Rights Reserved.

    Support


    Please leave a message and we'll get back to you soon.

    I agree to be contacted via e-mail.