serenity-bdd / serenity-cucumber

Cucumber integration for the Serenity BDD Reporting library
Other
78 stars 74 forks source link

Unable to click hyperlink on Linux. Getting noSuchElement exception #99

Closed Ravi-Prasad closed 6 years ago

Ravi-Prasad commented 6 years ago

We are able to click hyperlink on windows using JS Executor but not able to click hyperlink on Linux. We are using headless browser ie., PhantomJs. We have tried Actions and WebElement Click and JS Executor Click to click the hyperlink but none of the option worked out. Thanks in advance

wakaleo commented 6 years ago

This sounds like a phantomJS issue. Do you have anything that indicates that the problem is coming from the Serenity code (e.g. it works with raw webdriver but not with a WebElementFacade?

Ravi-Prasad commented 6 years ago

No, we have tried with raw webdriver alone but not with WebElementFacade . It was working fine earlier but lately we are getting org.openqa.selenium.NoSuchElementException: Timed out after 2 seconds. Element not found error message. As I said earlier it is working fine in my local and on Jenkins Slave machine(Windows). But getting error when we hit the pipeline runs on Linux. We are using below JS to click the element - JavascriptExecutor executor = (JavascriptExecutor) consolePage.getDriver(); executor.executeScript("arguments[0].click();", element);

wakaleo commented 6 years ago

This sounds like an environment-specific issue, possibly a PhantomJS bug. If it works locally it is unlikely to be a WebDriver issue. Have you considered using chrome in headless mode, or xvfs on the Linux environment (phantom hs is not always 100% reliable)

Ravi-Prasad commented 6 years ago

haven't tried with chrome headless mode. Not sure how to use xvfs on the Linux environment. Thanks

wakaleo commented 6 years ago

Closing as unrelated to serenity-cucumber.