Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>None of the above solutions worked for me. This did the trick tho:</p> <h3>Java</h3> <pre class="lang-java prettyprint-override"><code>element.sendKeys(org.openqa.selenium.Keys.CONTROL); element.click(); </code></pre> <h3>Groovy</h3> <pre class="lang-java prettyprint-override"><code>element &lt;&lt; org.openqa.selenium.Keys.CONTROL element.click() </code></pre> <h3>Geb</h3> <p>Or, if you're using <a href="http://www.gebish.org/" rel="noreferrer">Geb</a>, there's an even <em><strong>better</strong></em> solution that's completely unobtrusive:</p> <p>(tested with IE7 and <a href="http://www.gebish.org/manual/0.7.0/" rel="noreferrer">Geb 0.7.0</a>)</p> <pre class="lang-java prettyprint-override"><code>abstract class BaseSpec extends geb.spock.GebSpec { static { def oldClick = geb.navigator.NonEmptyNavigator.metaClass.getMetaMethod("click") def metaclass = new geb.navigator.AttributeAccessingMetaClass(new ExpandoMetaClass(geb.navigator.NonEmptyNavigator)) // Wrap the original click method metaclass.click = {-&gt; delegate &lt;&lt; org.openqa.selenium.Keys.CONTROL oldClick.invoke(delegate) } metaclass.initialize() geb.navigator.NonEmptyNavigator.metaClass = metaclass } } class ClickSpec extends BaseSpec { def "verify click"() { given: to HomePage expect: waitFor { at HomePage } when: dialog.dismiss() // Call the wrapped .click() method normally $('#someLink').click() then: waitFor { at SomePage } } } class HomePage extends geb.Page { static url = "index.html" static at = { title == "Home - Example.com" } static content = { dialog { module DialogModule } } } class SomePage extends geb.Page { ... } class DialogModule extends geb.Module { def dismiss() { ... } } </code></pre> <p>In my case, clicking in IE7 appeared to fail whenever it was preceded by the closing of an animated modal overlay (we're using <a href="http://jquerytools.org/demos/overlay/modal-dialog.html" rel="noreferrer">jQuery Tools Overlay Modal Dialog</a>). The Geb method above solved this problem.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload