Closed mariemignot44 closed 8 years ago
Have you tried using browser.pause()
to debug your problem?
Sometimes it helps to try and use browser.actions().mouseDown(frenchButton).mouseUp().perform();
.
This happens to me sometimes in dropdowns in firefox. Might be worth a shot.
Thanks for your replies.
@sjelin yes I tried. I added browser.pause() before and after clicking: 2 clicks are needed by protractor. If I click manually during the pause, only 1 click is needed
@Droogans I tried browser.actions().mouseDown(frenchButton).mouseUp().perform();
but it is not better, protractor needs these actions twice.
I also tried browser.actions().mouseMove(frenchButton).click().perform();
, without success.
I can confirm that I also had similar issue which was solved by double clicking.
I'm trying to update protractor to 3.0.0, because webdriver used by 2.x.x does not support Firefox 43 anymore.
It looks like something has changed in webdriver 2.48.2, because I have similar issues as mentioned above. In some cases I need to click twice. Sometimes when I call element.click()
Firefox tries to scroll to this element, but e.g. because of parallax that messes up scroll height, fails, the element is outside of viewport and element.click()
does nothing - there's no error, but the element is not clicked. Things like element.getText()
work correctly though. I fixed it by adding a helper that scrolls to the element using element.scrollIntoView()
and call it before clicking anything. The way Firefox finds elements by itself (unlike e.g. Chrome) was the main reason for me to use it in e2e tests...
I'm not sure if these 2 issues are related, e.g. if the second click scrolls the page so that the element is in the viewport and the click actually works.
Yea I have been trying to do the click twice using protractor and it hasnt been working out. I did Droogan's suggestion and I tried browser.pause() too. The browser I am using is chrome for a testing a non-angular single page application
I'm closing this issue as stale - there's a couple bugs listed that I think aren't actually the same thing, and no way for us to reproduce them. If you are still having an issue that you can show us in a reproducible example, please open up a new issue. Thanks!
@mariemignot44 , I am facing the same "Twice click" issue. Did you find any workaround other than clicking twice?
Hello,
I would like to test i18n on my angular website. There is a French link and an English link in the footer:
Here is my protractor test:
This test is ok, but if I comment one of the 2
frenchButton.click();
, the test fails (timeout in browser wait, nothing translated). I tried to change the template to:but this is the same result as the code above. I also tried
browser.wait(EC.elementToBeClickable(frenchButton), 5000);
but it doesn't work betterThe browser is FF 39.0. When I manually click on the frenchButton, a single click is needed to translate the page. I also tried to pause protractor and manually click on the frenchButton, the page is translated after the 1st click. My buttons are on the bottom of page, so their coordinates can change during the translation because the content height changes. I tried with
browser.waitForAngular()
but the test still fails. How can I check if the click event is emitted by the 1st click? Thank you for your answer.