I created another question, which, in my opinion, is the cause of this error: Why does the Selenium Firefox Driver consider my modal not visible when the parent has an overflow: hidden?
Selenium version 2.33.0
Firefox driver
Error code:
System.Threading.Thread.Sleep(5000); var dimentions = driver.Manage().Window.Size; var field = driver.FindElement(By.Id("addEmployees-password")); //displayed is true field.Click(); //works fine var element = driver.FindElement(By.Id(buttonName)); //displayed is false element.Click(); //errors out
The button that is trying to click:
<div id="addEmployees" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="addEmployeesLabel" aria-hidden="true"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h3>Add Employee</h3> </div> <div class="modal-body"> <p class="alert alert-info"> <input name="addEmployees-username" id="addEmployees-username" /> <input name="addEmployees-password" id="addEmployees-password" type="password" /> <input name="addEmployees-employee" id="addEmployees-employee" /> </p> </div> <div class="modal-footer"> <button name="addEmployees-add" id="addEmployees-add" type="button" class="btn" data-ng-click="submit()">Add</button> </div> </div>
- If I change the call to
FindElements , then I will get ONE element, so there is nothing on the page. - If I
FindElement in the field that occurs immediately before the button, say addEmployees-employee , then addEmployees-employee is displayed - In the browser itself, it displays well, all I have to do is actually click a button and execute the desired behavior, but the webdriver refuses to consider the displayed element
How can one field be displayed and the other not?

Modal with the add button in the lower right corner all other elements are displayed = true
The window size is 1200x645 on driver.Manage().Window.Size;
Item location: 800x355y on driver.FindElement(By.Id(buttonName)).Location
Elements sizes: 51x30 on driver.FindElement(By.Id(buttonName)).Size
Password item location: 552x233y on driver.FindElement(By.Id("addEmployees-password")).Size
angularjs c # selenium-webdriver angular-strap
ton.yeung
source share