I have a problem when clicking on a button using IE 9 !
Basically, i just need to do this:
WebElement submit = driver.findElement( By.xpath( "//button[@class='gwt-Button']" ) );
It works in FF but fails in IE
WebElement submit = driver.findElement(By.xpath( "//button[@class='gwt-Button']"));
Try to click on someother element on page and then try the above code. This ensures that the browser gets the control & focus.
Winds of Change
i do that. enter some text in the username and password textbox. Also, if i try to get the caption of the button it works ( so the xPath is correct) but fails for click action :-(
Check the source code from IE. Is the same structure shown in FF?
Also try using CSS like, button.gwt-Button
If not works, then try to fire some events like onFocus
Thank/Like to help others if my input helped you !!!
I am speaking for myself, not for my employer nor any one.
i solved the problem by changing the "submit.Click " with "submit.sendKeys(enter). For some reason the click is not recognized :-(
Another problem i see with using the .click in IE9 is with a tabbed object. I try to hover or click on a tab but nothing happens
The code is like:
HOVER ->hoverAction.moveToElement(driver.findElemen t( By.xpath( "//*[@id='gwt-uid-65']" ))).build().perform();
CLICK->driver.findElement( By.xpath( "//*[@id='gwt-uid-69']" )).click
No errors are reported
Ah shame on me :-)
The problems related to the .click and hover actions with IE were related to the browser's zoom level. By setting it to 100% it works ;-)