Quality Testing

Quality is delighting customers

Selenium Webdriver: Can not create method for 'Find Element (By.Id())

Hi All ,Created method as

public void WaitForElementById(WebDriver driver, String locator)throws Exception {

try {

int i = 0;

for (i = 1; i < 5;) {

if (driver.findElement(By.id(driver, By.id(locator))))

{// driver.FindElement(By.LinkText(locator)).Click();

break;

}

else {

Thread.sleep(2000);

i++;}}

 

 

}

catch (Exception e) {

}

}

Showing error as '

The method id(String) in the type By is not applicable for the arguments (WebDriver, By)'

Please guide

 

Views: 32

Reply to This

TTWT Magazine

Welcome to Quality Testing!

Sachin Natu

 Manager QA at IdeaS Revenue Optimization

Advertisement

Submit A Job

Submit A Tool

Advertisement

Videos

  • Add Videos
  • View All

Badge

Loading…

© 2013   Created by Quality Testing.

Badges  |  Report an Issue  |  Terms of Service