Reputation: 1058
I am testing the SSO functionality we added to our website. The problem is that the automated test is using a static test-box that has some browser installed on it and it will just start that browser.
If a previous test has logged in successfully, then the subsequent test will not be presented with an SSO login screen (already logged in) and then my test doesn't know if the SSO login page was not shown due to a bug or due to a logged-in session.
I can't use Incognito in my tests. The browser instantiation code is very complex and I am not allowed to change it yet.
Is there something like my_driver.cleanup()
so that each log in attempt will result in an SSO login page (even if browser just logged in, from a previous test)?
We are using Chrome and FireFox browsers for our testing.
Upvotes: 0
Views: 626
Reputation: 480
If you know the session cookie your SSO provider is using, you could clean it after selenium test performs logout from your application.
In my case SSO is implemented with MS Azure AD and the code to "clean SSO session" is like this (WebDriver driver)
driver.get("https://login.microsoftonline.com/common/oauth2/v2.0/logout")
driver.manage().deleteAllCookies()
Upvotes: 1