Hi all,
Mike here. I would like to share with you an issue that I have that is blowing my mind.
A bit of context, I have automated a web application using @FindBy strategy for the webElements. We use jenkins with this code and it works fine, no issues here. But now, I'm jumping from @FindBy and webElements to use locators BY.
After updating the whole selectors of the project, when I execute the jobs for triggering test automation, then I have a very strange issue which is that the driver is not instantiated randomly.
So my problem is that I have a timeoutexeption
org.openqa.selenium.TimeoutException: Expected condition failed: waiting for visibility of (tried for 10 second(s) with 500 milliseconds interval)
As you can see, even in the stacktrace it's waiting for something that is not there, you can verify there is an empty space when the selector should be.
This issue happens locally as well but im not able to get anything from it. If I execute via jenkins, I'm able to see what is happening using LOG information (thats how i know that driverIsInstantiated() returns FALSE). I have tried to create a new ChromeDriver after it didnt fix tje issue. seems like im not able to "attach" the session to that driver.
I dont know what is happening but the issue is that the browser is never opened, that's for sure. I suppose it can be serenity because if i create my own driver and i dont use the @Managed annotation, it works perfectly.
This is the stack trace i have with the error but i think is not really helpful as its about the waitElement
10:05:30 org.openqa.selenium.TimeoutException: Expected condition failed: waiting for visibility of (tried for 10 second(s) with 500 milliseconds interval) 10:05:30 Build info: version: '4.6.0', revision: '79f1c02ae20' 10:05:30 System info: os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.0-9-amd64', java.version: '11.0.6' 10:05:30 Driver info: net.thucydides.core.webdriver.DevToolsWebDriverFacade 10:05:30 at org.openqa.selenium.support.ui.WebDriverWait.timeoutException(WebDriverWait.java:87) 10:05:30 at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:231) 10:05:30 at framework.utils.Utils.waitForConditionVisibility(Utils.java:241) 10:05:30 at framework.utils.Utils.clicker(Utils.java:117) 10:05:30 at framework.pages.Page.accessToEntityListingPage(AnyPage.java:281) 10:05:30 at framework.steps.Steps.accessToEntity(AnySteps.java:112) 10:05:30 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 10:05:30 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 10:05:30 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 10:05:30 at java.base/java.lang.reflect.Method.invoke(Method.java:566) 10:05:30 at org.jbehave.core.steps.StepCreator$ParametrisedStep.perform(StepCreator.java:790) 10:05:30 at org.jbehave.core.embedder.PerformableTree$FineSoFar.run(PerformableTree.java:349)
Note: clicker is a method that makes .click()
POM
`
3.4.31.46.03chromecom.google.guavaguava31.1-jrenet.serenity-bddserenity-core${serenity.core.version}net.serenity-bddserenity-jbehave${serenity.jbehave.version}junitjunit4.13.2org.slf4jslf4j-simple2.0.5org.apache.commonscommons-configuration22.8.0org.hamcresthamcrest-library2.2test${environment.filter}src/test/resourcesfalsesrc/test/resources-filteredtrueorg.apache.maven.pluginsmaven-compiler-plugin3.10.11.81.8org.apache.maven.pluginsmaven-surefire-plugin3.0.0-M7org.apache.maven.pluginsmaven-failsafe-plugin3.0.0-M7org.apache.maven.surefiresurefire-junit43.0.0-M7**/story/*.java-Xmx1024m${webdriver.driver}${parallel.tests}falsesuitesAndClasses${parallel.tests}falseintegration-testverifynet.serenity-bdd.maven.pluginsserenity-maven-plugin${serenity.core.version}${project.build.directory}/site/serenity${project.build.directory}/site/serenityserenity-reportspost-integration-testaggregate`
So a quick resume:
- With @FindBy it works fine
- With By it doesn't work
- Browser is not opened but the test case tries to do his stuff
- driverIsInstantiated() == false
- Using custom driver instead of Serenity @Managed works fine
- Not much info retrieved from the execution
Thank you for your support and sorry for the poor explanation, but i think its all I have
Hi all, Mike here. I would like to share with you an issue that I have that is blowing my mind.
A bit of context, I have automated a web application using @FindBy strategy for the webElements. We use jenkins with this code and it works fine, no issues here. But now, I'm jumping from @FindBy and webElements to use locators BY. After updating the whole selectors of the project, when I execute the jobs for triggering test automation, then I have a very strange issue which is that the driver is not instantiated randomly.
So my problem is that I have a timeoutexeption
org.openqa.selenium.TimeoutException: Expected condition failed: waiting for visibility of (tried for 10 second(s) with 500 milliseconds interval)
As you can see, even in the stacktrace it's waiting for something that is not there, you can verify there is an empty space when the selector should be.This issue happens locally as well but im not able to get anything from it. If I execute via jenkins, I'm able to see what is happening using LOG information (thats how i know that
driverIsInstantiated()
returns FALSE). I have tried to create a new ChromeDriver after it didnt fix tje issue. seems like im not able to "attach" the session to that driver.I dont know what is happening but the issue is that the browser is never opened, that's for sure. I suppose it can be serenity because if i create my own driver and i dont use the @Managed annotation, it works perfectly.
This is the stack trace i have with the error but i think is not really helpful as its about the waitElement
10:05:30 org.openqa.selenium.TimeoutException: Expected condition failed: waiting for visibility of (tried for 10 second(s) with 500 milliseconds interval) 10:05:30 Build info: version: '4.6.0', revision: '79f1c02ae20' 10:05:30 System info: os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.0-9-amd64', java.version: '11.0.6' 10:05:30 Driver info: net.thucydides.core.webdriver.DevToolsWebDriverFacade 10:05:30 at org.openqa.selenium.support.ui.WebDriverWait.timeoutException(WebDriverWait.java:87) 10:05:30 at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:231) 10:05:30 at framework.utils.Utils.waitForConditionVisibility(Utils.java:241) 10:05:30 at framework.utils.Utils.clicker(Utils.java:117) 10:05:30 at framework.pages.Page.accessToEntityListingPage(AnyPage.java:281) 10:05:30 at framework.steps.Steps.accessToEntity(AnySteps.java:112) 10:05:30 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 10:05:30 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 10:05:30 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 10:05:30 at java.base/java.lang.reflect.Method.invoke(Method.java:566) 10:05:30 at org.jbehave.core.steps.StepCreator$ParametrisedStep.perform(StepCreator.java:790) 10:05:30 at org.jbehave.core.embedder.PerformableTree$FineSoFar.run(PerformableTree.java:349)
POM `