MarkusBernhardt / robotframework-selenium2library-java

Java port of the Selenium 2 (WebDriver) Python library for Robot Framework
Apache License 2.0
46 stars 48 forks source link

Selenium2 execution speed incredibly slow with jar without dependencies using httpcore 4.3 beta 2 #34

Closed Andrei-Straut closed 10 years ago

Andrei-Straut commented 11 years ago

I would like to point out an issue I've noticed with Selenium (apparently it's from WebDriver, not from the library itself). I am opening this issue here because it was discovered in the context of Selenium, and someone may come to read it. Also, this issue did not happen with the jar-with-dependencies, as it had the correct version packed. Unfortunately, we could not use it in production due to conflicts with other jars we needed, so we resorted to the simple jar.

Httpcore 4.3 is not explicitly listed as a dependency in the Selenium library pom, but it is rather a transitive dependency from PhantomJS driver (4.2.1 version, we haven't tested with it, we went straight to 4.3). However, changing the version had an impact across multiple browsers (I was able to confirm HttpUnit, Chrome, and Firefox, PhantomJS didn't work for us and always returned a blank page, even with wait for script execution, I assume due to the fact that the application under test is GWT).

Execution speed when using httpcore 4.3 beta 2 is orders of magnitude slower than when using 4.3 release version (I'm talking about 6-7 second differences in a simple findElement operation - 450 milliseconds with the release version, 6.5 - 7.5 seconds with the beta version). And it's not just the findElement operation, everything happens in slow mode, from browser opening (Firefox takes about 30 seconds to open, Chrome about 20) to URL navigation, input texts and element clicks.

In a suite containing about 44 complex GUI tests, we managed to decrease execution speed from 2.5 hours to about 20 minutes after changing the http core version.

I reiterate again: For anyone who might have speed issues with Selenium, and tried most described fixes, check you http core version. 4.3 release (found here), worked wonders for us.

@MarkusBernhardt : Can you please confirm this issue if possible, and if proven true, can you mark it as resolved?

MarkusBernhardt commented 10 years ago

I think that could almost be expected, as in the 4.3 beta there where a lot of performance related changes. Thanks for that information, but I really don't know, what I should do or what to test. So I'm closing that now.

If there is something I should have done, please contact me again.

Andrei-Straut commented 10 years ago

Hm, I was thinking about a test run using beta 3 in the classpath, I should have stated this in the description.

However, seeing as you seem to be aware of performance-related changes in this particular version, no, I believe it is enough as is, and no other steps are necessary. Besides, I had opened the issue more to inform the library users (and yes, I probably should've opened it to the Selenium developers), and not really as a bug in itself. Thanks again!