0

I'm running a bunch of selenium UI tests in cent os 7 using selenium-java 2.39.0, chromedriver 2.22.

All the test cases can run smoothly in parallel(I've set parallel="tests" in the testNG xml) under the terminal command line, chrome/chromedriver can exit smoothly and successfully after all the test cases completed.

However when I run the same tets cases under jenkins 2.7.2(also tried lower version of Jenkins such as 1.644) using exactly the same test script, there are always some chrome browsers can't exit successfully after a test case completed and driver.quit was called, and gradually there will be many chrome browsers hang there. The following snapshot is an example of how the chrome browser is hanged there:

google chrome is not responding

I'm sure jenkins use the same shell, same chromedriver and same selenium when running the UI tests, just wonder how come there will be no chrome/chromedriver hang issue when running these test cases in command line, but randomly hang when run in jenkins? BTW, all the UI test cases running in jenkins that are under windows platform is also ok, it only happens in jenkins that is on a Cent OS 7 machine.

1 Answer 1

0

We struggled with a similar situation with our testing efforts. We also wanted to leverage the TestNG parallelization along with Selenium web driver. Unfortunately, managing the web driver life cycle within each test class or trying to use a static class holding the web driver wasn't effective when enabling any of the TestNG parallel modes. ie. parallel="tests|classes|methods". Matching classes and methods under test with the active TestNG thread and the instantiated web driver was unwieldy when it worked at all. We were spending more time figuring out the web driver lifecycles than getting to the real web application tests. We found a better way. We have an open source project that abstracts away the web driver lifecycle management for TestNG/Selenium testing. It properly supports each of the TestNG parallel modes providing the correct and active web driver for each test class method under test. It's helped us greatly in our testing efforts. Perhaps it may be of use in your case as well. Or if nothing else give you an idea of how you might tackle it differently. We haven't yet integrated with Jenkins, but this may help. The project is over on GitHub as Concurrent Selenium TestNG (COSENG). Kind regards.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.