Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open_Application does not always start app with webdriver #244

Closed
mengelskirchen opened this issue Dec 20, 2021 · 1 comment · Fixed by #243
Closed

Open_Application does not always start app with webdriver #244

mengelskirchen opened this issue Dec 20, 2021 · 1 comment · Fixed by #243

Comments

@mengelskirchen
Copy link
Contributor

mengelskirchen commented Dec 20, 2021

Issue

DesktopLibrary#open_application does not start the app with webdriver#remote when the attribute window_name is given.

The result is that the application may be started with an other user than webdriver is running with and as it with other user rights than intended.

if window_name:
# If the app has a splash screen we need to supply the window_name of the final window.
# This code path will start the application and then attach to the correct window via
# the window_name.
self._info('Opening application "%s"' % desired_caps['app'])
subprocess.Popen(desired_caps['app'])
if splash_delay > 0:
self._info('Waiting %s seconds for splash screen' % splash_delay)
sleep(splash_delay)
return self.switch_application_by_name(remote_url, alias=alias, window_name=window_name,
exact_match=exact_match, desktop_alias=desktop_alias, **kwargs)
# global application
self._open_desktop_session(remote_url, desktop_alias)
if "platformName" not in desired_caps:
desired_caps["platformName"] = "Windows"
if "forceMjsonwp" not in desired_caps:
desired_caps["forceMjsonwp"] = True
application = webdriver.Remote(str(remote_url), desired_caps)
self._debug('Opened application with session id %s' % application.session_id)
return self._cache.register(application, alias)

@Wolfe1
Copy link
Member

Wolfe1 commented Dec 20, 2021

While I agree that what you have here is cleaner I believe there was a reason I went with subprocess before. I think it had to do with Webdriver.Remote failing after the splash screen disappears.

I will take a look on my end though with some internal tests with splash screens sometime this week.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants