Quality Testing

Quality is delighting customers

Hi,

  

I am trying to click on a button with using a CSS selector in Selenium 2.0 WebDriver. The issue is the script which I am able to run with Selenium RC is not working with WebDriver. Code:

Selenium RC:

selenium.click("css=.gwt-Button:contains('Run Query')");

which works absolutely fine.

Selenium WebDriver:

driver.findElement(By.cssSelector(".gwt-Button:contains('Run Query')")).click(); 

which is not work. I am using: selenium server-standalone-2.9.0.jar with Firefox version 5.0. Could anyone help me in figuring out why the cssSelector is not working with WebDriver?

Thank You 

Hari

Views: 135

Reply to This

Replies to This Discussion

Hi Hari, 

Modify the CSS Selector using any one of the methods mentioned here in this post 'Dynamic CSS Selector in Selenium WebDriver'. 

It may help you.

Thanks.

Thank you Rajkumar

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2019   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service