Selenium webdriver wont start on certain cucumber tag's - Stack Overflow

admin2025-04-16  2

I'm working on a Selenium Java test automation project, and I encountered a strange problem that I can't seem to understand the cause of.

The project configuration is as follows:

Selenium 4.28.1
Gherkin 31.0.0
Cucumber 7.21.0
JUnit 4.13.2

We use IntelliJ 2024.3.2 to run tests locally. On the cloud, we execute the test suite using the mvn command.

When I run the tests using the mvn command, I don’t encounter the problem. However, when I use the test runner in the IDE:

Some tests won't run. For example, every time I include the tag @filter in the .feature file:

(For tests that use the filter function) the WebDriver launches but never navigates to the siteURL. The browser stays stuck, and the test eventually fails.

It happens only with that tag, and I don't understand why.

The other day, I had the same problem when I tried changing the scenario text in a feature file. Simply changing one letter, building, and running the test caused the same issue. However, when I reverted the change, it worked without any problems.

I hope someone can help me with this. Thank you!

FYI, deleting the tag after the test fails won't solve the problem. It's as if the test is permanently marked as using @filter and will never launch.

The only way to run the test using the IDE runner/debugger is to copy the scenario into another .feature file that doesn't have the @filter tag.

转载请注明原文地址:http://www.anycun.com/QandA/1744760656a87234.html