-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
org.openqa.selenium.WebDriverException: Driver isn't initialized. This extension can only be used in combination with the DriverParameterResolver #661
Comments
@fabb you trying run 'gradle test' or something else ? if also getting error, then error caused not by java test runner |
I found a likely reason for the problem. My project uses an
It seems like the Java Test Runner does not correctly apply those annotations when running tests. |
@fabb Thank you for the information, I'll take a look and update you when I have any progress. |
Hi @fabb Is that possible for you to share a sample project which can repro the issue? |
I‘ll try to reproduce it in an example project, could take me a while as I‘m swamped currently. |
That will be great. Thanks a lot |
I could reduce the project enough to also trigger a similar error in IntelliJ. It seems to be connected to auto-activated profiles in the pom. I have this section in my pom:
I will upload my project shortly, yet need to kick a few private things out first. |
Ok, here you go: https://github.com/fabb/vscode-java-test-bug The bug really seems to be related to the |
Hi @fabb, Thank you for the sample project you have provided, which is very useful! I can now repro the issue now and here are my findings so far. Root CauseThe Test Runner does not honor the section: <systemPropertyVariables>
<buildDirectory>${project.build.directory}</buildDirectory>
<webdriver.gecko.driver>
${driver.folder}geckodriver-${driver.platform}-${driver.arch}bit${driver.extension}
</webdriver.gecko.driver>
<webdriver.firefox.logfile>/dev/null</webdriver.firefox.logfile>
</systemPropertyVariables> WorkaroundFor now, there is a workaround which is to manually pass the properties into the JVM. You can add a new setting into your workspace: {
"java.test.config": {
"vmargs": [
"-Dwebdriver.gecko.driver=D:\\work\\Java\\test-runner-bug-proj\\issue-661\\drivers\\geckodriver-windows-64bit.exe",
"-Dwebdriver.firefox.logfile=/dev/null"
]
}
} Open the Then paste the setting into there, just notice that the path Follow-upI'll keep investigating how to resolve it automatically. |
Thank you a lot for your fast response! |
I'm trying to run junit5 selenium tests with the Java Test Runner. I always get this error message:
I guess this is related to the
webDriver
parameter that the test method expects:I googled for
DriverParameterResolver
but found absolutely nothing. Is it possible to run selenium tests with this extension, and if yes, how?The text was updated successfully, but these errors were encountered: