I am writing autotests with Watir-WebDriver and Ruby 1.9.2 on Ubuntu for the web. I have an iframe with multiple elements. I need to click on the items and check what happens. <iframe> as follows:
<iframe id="iframe" align="top" some_attribute="some_attribute"> <html> <head> <title> Some title </title> </head> <body> <div> <button id="id_button" type="button" class="some_class"/> </div> </body> </html> </iframe>
When I click on the button, it should create a menu. But when I click the button using watir-webdriver, nothing happens as if it didn't click. Watir does not print any exceptions, but do not click a button.
This issue persists only for Internet Explorer. There are no problems for Firefox and Chrome. My code looks like this:
browser = Watir :: Browser.new (: remote,: url => "http://some_ip:4444/wd/hub",: desired_capabilities =>: internet_explorer) browser.goto ("http://some_http.com") browser.iframe.button (: id, "id_button"). click
If i write
browser.iframe.button(: id, "id_button").attribute_value("class")
It returns "some_class" . This means that the element is recognized, but nothing happens.
source share