Home > Automation Testing, Java, Programación, Selenium > WaitForTitle Selenium IDE to Java + testng

WaitForTitle Selenium IDE to Java + testng

February 8, 2017 Leave a comment Go to comments

This is the code translated from selenium IDE waitForTitle Command to Java code with TestNG.

    for (int second = 0;; second++) {
    	if (second >= 60) org.testng.Assert.fail("timeout");
    	try { if ("My Title here".equals(driver.getTitle())) break; } catch (Exception e) {}
    	Thread.sleep(1000);
    }

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: