Docker-selenium: Open xdg-open

Created on 17 May 2017  路  6Comments  路  Source: SeleniumHQ/docker-selenium

Meta -

Image(s):
node-chrome
Docker-Selenium Image Version(s):
3.4.0
OS:
OSX El capitan 10.11.6

On trying open a link like: intent://stream/#Intent;scheme=freevr;package=[PACKAGE_NAME];S.stream=[STREAM_URL] the xdg-open 'alert' appears. That makes losing control over the driver, per example the driver is unable to do a navigate.refresh.

Expected Behavior -

On opening such type of links, no other application than Chrome should not 'pop-up'.

Actual Behavior -

xdg-open tries to open such content from the URL and the driver stops working.


This is the trace of the error on trying a refresh once the 'xdg-open' pops up:

objc[4481]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.

org.openqa.selenium.TimeoutException: timeout
  (Session info: chrome=58.0.3029.81)
  (Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 4.9.27-moby x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 15.01 seconds
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: '8889888d9c2b', ip: '172.17.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.27-moby', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5), userDataDir=/tmp/.org.chromium.Chromium.U0CuT5}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=58.0.3029.81, platform=LINUX, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}]
Session ID: 02bfe2b83b3bd65900eb2a3293accddb
Command duration or timeout: 15.02 seconds

Here is a screenshot of the xdg-open pops up:
image

All 6 comments

Hi @lluisteamcmp thanks for reporting this.

Do you think you can also provide a solution? and even better via a pull request?

if this is a valid issue, then it's most likely an issue with SeleniumHQ/selenium - i'll await your response @lluisteamcmp

Hi @elgalu @ddavison I see this more as an issue that could be solved by modifying the dockerfile from the base node: https://github.com/SeleniumHQ/docker-selenium/blob/master/Base/Dockerfile
Something to make the xdg-utils not interact in such way: https://wiki.archlinux.org/index.php/Default_applications#xdg-utils
I will try to have a solution, but I have little knowledge on solving this type of issues.

@elgalu @ddavison I think this could be closed. This problem is more related to trying to test an intent to open an app using a desktop, simulating the mobile by the user agent.
Also I can reproduce the behavior of 'loosing' the driver on other environments than the docker node container.
I will open an issue to SeleniumHQ/selenium for this strange behavior when opening this intent type URL, but I to play fair, this is more related about using the wrong tool for the test. I should move to something like Appium to do such tests.

I agree. I will close but if you figure this out please post the link or the solution here so we can all learn from it ;)

Was this page helpful?
0 / 5 - 0 ratings