2
votes

I am using SeleniumLibrary which is a wrapper for Selenium to use with Robot Framework.

In some cases I need to start the browser as a different user because the application I am testing will otherwise use my Windows credentials (SSO) which I do not want.

This is easy to do manually with the Windows "run as" feature. I can also automate this in various ways.

However: I need to automate this "run as" using SeleniumLibrary, because if the browser isn't started using Selenium, I can't automate my actions in it using Selenium either.

I have looked into desired capabilities of the webdriver but there don't seem to be any posibilities there. I have found solutions here that say I should use a browser profile, but without explanation on how to setup such a profile using a different user. I also found this solution but I don't really understand it, it uses Selenium directly which I cannot do and it seems to require the code to run on a different machine with the required user logged in there which isn't a possibility for me.

I need to be able to run a browser on the same machine without it using the credentials of the logged in Windows user.

TL/DR version: How can I start a browser session using "open browser" or "create webdriver" keywords in SeleniumLibrary?

The solution needs to work with the common browsers IE, Chrome and Firefox (and possibly Edge)

1
I would like to start a browser as a different user because the application I want to test uses single sign-on and would otherwise use the credentials of my logged in Windows user. But that Windows user doesn't have sufficient rights for the application so I need to be able to login with a user who does have the correct rights. - Mytzenka
Do you have this issue when working in an Incognito browser? - A. Kootstra

1 Answers

2
votes

Based on the comments from Jim Evans (Creator IE Driver) on a similar GitHub Issue this is a wish that won't be supported.

... we won't be adding a Windows-only feature to a cross-platform API ...

In addition the referenced article highlights that the regular programming route to take doesn't work as expected.

This is why the article's writer fell back on having multiple machines with a different user logged into each. This circumvents the problem, not solves it. Given that you desire a single machine setup, I'm going to say that this isn't possible with the current software support; whatever the browser brand.