Closed Kiran-CGI closed 7 years ago
I am also having this issue in IE, it did not make actually click on web element, I am using selenium driver 2.53
There's some issue with the focus in some cases. A workaround would be clicking first on the parent and then on the element if possible
I can reproduce this problem using Selenium 2.52 and ff 45.0.1.
@ckorakidis your workaround works like a charm, could you please give me more info about this issue so that I can investigate further? Our tests were working fine until last week so I don't know if it's something we introduced that is triggering the problem.
Thanks.
selenium .click() in IE sometime work in weird way, it will wait forever until a new window is loaded. if we do not open a new window, we probably fall to this issue. Try javascript click instead ((IJavaScriptExecutor)Driver).ExecuteScript("arguments[0].click()", Driver.FindElement(By.CssSelector("input .classname")));
Dear all, In my case i ve found that element is not loading perfectly sometimes when the webdriver is trying to click.
Thanks.
Hi,
Apologies for not responding earlier, it was lost in my notifications.
So there are issues with click (in some cases it hangs, or it pretends it clicked when it didn't) on IE. To my experience no solution is perfect, a combination would reduce the failures though. The click on parent first was taken from http://stackoverflow.com/questions/5574802/selenium-2-0b3-ie-webdriver-click-not-firing. It's not panacea and in some cases, depending on your design, clicking on the parent could lead to having your element listening on the click event, so clicking on the parent and then on your element could lead to two clicks on your element. In some cases this could lead to weird behaviour (I had to realise it by analysing the network traffic). If you realise that this is the behaviour, I'd suggest you first click on some other place (of the same iFrame) you know it won't have any other effect except for the focus. The Keys.Enter didn't work as expected in my case: the click was successful but after that I had issues with the next commands (possibly related to focus or some other reason). The Actions approach seems to work in most of the cases: new Action(driver).moveToElement(myElement).click().perform(), so I use a combination of this and the first approach (click on parent or some other save-to-click place before clicking on myElement), depending on the interface. @acontell The click issues on IE are not constant and you could experience this even when you changed nothing. In general, to my experience, when the time management (loading of the page, or part of the page through some ajax, finishing of the previous action etc) in the front-end is not perfect, or the use of it is not perfect (e.g. not using waits where needed), you could face issues just because the server respond time changed for a small portion. If you run your tests in many iterations (e.g. using jmh), you'll realise that they fail more often than running them just once.
No repro case, and no comments in 10 months. Closing.
Meta -
OS:
Selenium Version:
Expected Behavior - The code is expected to click on payment templates and then click on load more link which appears in that page
@Test @Parameters({"browser", "userName", "password"}) public void loginWebFX(String browser, String userName, String password) throws Exception { String userNameTextBox = PropertiesFileReader.getPropertyValue("login.userName.textBox"); String passwordTextBox = PropertiesFileReader.getPropertyValue("login.password.textBox"); String menuIcon = PropertiesFileReader.getPropertyValue("home.page.menu.icon"); String paymentTemplates = PropertiesFileReader.getPropertyValue("home.page.menu.paymentTemplates"); String loadMore = PropertiesFileReader.getPropertyValue("paymentTemplates.loadMore"); String rowsPT = PropertiesFileReader.getPropertyValue("paymentTemplates.rows");
Actual Behavior -
But actually the selenium passes the click step without actually clicking on the payment templates link though it is available.
After searching for the solutions in google i doubt my maven dependencies are in compatable with latest selenium jar ie 2.52.0 or 2.53.0
'''--------pom.xml------------'''
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">