Answered

How can we clear session or exit driver and open new driver within test case?

 

Hello,

Can we exit the driver and launch the new driver within test-case, or clear session information on existing instance.

 

Thank you,
Sateesh

0
4 comments
Avatar
Joseph Hamdan

Hi Sateesh,

Could you please elaborate as to what you are trying to achieve? We need more information to understand your request.

Regards,

Subject7 Team

0
Comment actions Permalink
Avatar
sateesh arra

We are working on automating SharePoint workflows with different profiles/roles.

Problem - Once a SharePoint site session is created, session is active until Guest Browser/driver is quit/closed. 
Only known way, we can login to SP as a different profiled user is by quitting the driver, or by clear the current session info.

Why I am thinking of quitting the driver within the test? – So that I can pass the parameters/variables  created within a workflow.

 

Thank you,

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Sateesh,

Can you try the below options to see if they work:

1- If opening SharePoint in a new tab creates a new session, in your test case, you can open a new tab using the script below in Execute_JavaScript command and continuing the test.

window.open("url")

2- If step 1 does not work, you can use the below script in Execute_JavaScript command to clear session:

sessionStorage.clear();

3- You can delete session cookies using Cookie command by selecting DELETE_ALL option

Regards,

Subject7 Team

0
Comment actions Permalink
Avatar
sateesh arra
 

Tried all these three options, it didn't work.

Just found a solution on Microsoft forms. 

using this option we can login as different user - https://<servername>/_layouts/closeConnection.aspx?loginasanotheruser=true

 

thanks for all your help

 

Sateesh

0
Comment actions Permalink

Please sign in to leave a comment.