Note that there are some explanatory texts on larger screens.

plurals
  1. POTwitter bootstrap modal buttons not working when clicked in Selenium
    text
    copied!<p>I'm wondering if anyone else has experienced this issue. I've got a website utilising twitter bootstrap, at one point in my script I open a modal, I go through and interact fine with several objects within that modal (text input, dropdown, checkbox). But when I come to clicking the submit button at the end nothing happens. </p> <p>As far as selenium is concerned it clicked it, and if I watch the screen while its running and could see the button highlight as if clicked, but nothing happens. If I then try to click on it afterwards still nothing happens other than the button highlights. If I then hit RETURN or ENTER then it fires fine...</p> <p>I've tried instead of clicking sending ENTER or RETURN but they all do the same thing and am at a complete loss, I identify the object via XPATH which as far as I can see looks right...</p> <p>Here's a chunk out of the code, bear in mind that everything before this works...</p> <pre><code>threadSesh.driver.findElement(By.xpath(".//*[@id='createDeal']").click(); threadSesh.driver.findElement(By.xpath("html/body/div[3]/div[2]/div/dl/dd[1]/input").clear(); threadSesh.driver.findElement(By.xpath("html/body/div[3]/div[2]/div/dl/dd[1]/input").sendKeys("MyNewProject"); Select myDropDown = new Select(threadSesh.driver.findElement(By.xpath("html/body/div[3]/div[2]/div/dl/dd[3]/select"))); myDropDown.selectByVisibleText("Buy Out"); threadSesh.driver.findElement(By.xpath(".//*[@id='ProjectOriginator']/li/input").click(); threadSesh.driver.findElement(By.xpath(".//*[@id='ProjectOriginator']/li/input").sendKeys("John smith"); threadSesh.driver.findElement(By.xpath("(//a[contains(text(),'Create')])[2]").click(); </code></pre> <p>Its the final line that just does nothing... Any suggestions would be very much appreciated!</p> <p>Also worth pointing out I am using ie and cannot test this in chrome or FF (neither version is allowed on this website I'm testing, its an internal platform).</p> <p>Another piece of potentially useful information, the button isn't a button in fact but a ref of some kind that's been made to look like a button using the twitter bootstrap stuff, the source for it looks like this: -</p> <pre><code>&lt;a class="btn btn-small btn-info" type="button" style="margin-right: 7px; padding-left: 15px; padding-right: 15px;" data-bind="click: ok" href="#"&gt;Create&lt;/a&gt; </code></pre> <p>If I record it in the seleneium addin for firefox it outputs this: -</p> <pre><code>driver.findElement(By.xpath("(//a[contains(text(),'Create')])[2]")).click(); </code></pre>
 

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