Forum Discussion
Hi,
I've had a test on my Windows 10 / SoapUI 5.2.1 and I can now reproduce the same error as you have:
org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09' System info: host: 'DESKTOP-ROM93IK', ip: '192.168.1.90', os.name: 'Windows 8', os.arch: 'amd64', os.version: '6.2', java.version: '1.7.0_55' Driver info: driver.version: ChromeDriver error at line: 9
Apart from:
replacing in /lib:
httpclient-4.1.1.jar -> httpclient-4.5.2.jar
httpcore-4.1.1.jar -> httpcore-4.4.5.jar
adding to /ext:
commons-exec-1.3.jar
gson-2.8.0.jar
selenium-api-2.53.1.jar
selenium-chrome-driver-2.53.1.jar
selenium-java-2.53.1.jar
selenium-remote-driver-2.53.1.jar
selenium-server-2.53.1.jar
I also had to add the following to /lib to correct a kernal 32 error (think its because I am using the packaged java 1.7.055, rather than the 1.8 you have)
jna-4.2.2.jar
jna-platform-4.2.2.jar
I think there may well be a windows specific error here when running via SoapUI, as explained here:
http://stackoverflow.com/questions/28823403/webdriver-exception-after-soapui-project-execution
Possibly the SoapUI code has been fixed in the Ready! API versions.
I'll have a go at patching the code as per that stack overflow post (proxyselector part). I also have a feeling that there may be an alternative set of jars that might be easier and/or work around this issue. I'll do some more digging when I get a chance...
Regards,
Rup
Hello guys,
I realize that this issue is a bit stale, but for the future generations I would like to say that that I have successfully solve it (and by the way thanks, previous comments were of great help to me). So to sum up:
1. Replace the following libraries under %SOAPUI_HOME%/lib (I simply moved out the old ones to an archive subfolder): guava, httpcore, httpclient (and in future you will probably have to replace more, cause the libs are pretty old)
2. Do not try to implement selenium script from a groovy test step, contrary to whatever is said on the selenium site, selenium is quite a tricky and unstable thing and it needs a lot of configuration and tweaking. This is not something a sane person would do, the work is enormous. Personally I converted a driver helper class from my old TAF which already supported detecting of a browser type & profiles, os platform etc
3. Assuming you can run your new lib with, say, Eclipse, you can now export it as a runnable jar. You need the option called "copy required libraries into a sub-folder next to the generated jar". When done you copy your new runnable jar + the libraries into %SOAPUI_HOME%/bin/ext. NOTE: Do not copy libs as a folder, but as a set of files, they need to be on the same level as your runnable jar.
4. Having failed to reliably reference selenium driver binaries from within the lib, I decided to keep them separately and take their location as a mandatory parameter when my lib starts. I guess, you'd better do the same
5. Finally, you need to write something like this in your groovy script (syntax heavily depends on whatever I have in my lib):
// this one imports my lib import app.helpers.* def dhelper = new app.helpers.DriverHelper() log.info("Library status: " + dhelper.healthCheck()) // these, of course can be parameterized def browser = "FF" def pathToSelenium = "C:\\work\\seleniums" log.info(browser) log.info(pathToSelenium) def wd = dhelper.getDriverInstanceByName(browser, pathToSelenium) wd.get("http://google.com")
Hope this helps. This worked for me.
Related Content
- 8 months agoDexterK