Run several instances of Edge via PS-sctipt

Hey folks,
I’m searching for a solution to start several MS Edge sessions as a predefined user from different Account.
We are running a test-system for testing a webapplication. This webapp is using SSO.
I created a script for our customers, to open the Webapp under the scope of a testuser:

$username = " testuser"
$password = ConvertTo-SecureString -AsPlainText -Force "Test123"

$cred = New-Object System.Management.Automation.PSCredential -ArgumentList $username, $password

$edge = "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"

Start-Process -FilePath $edge -Credential $cred -WorkingDirectory "C:\Windows" -ArgumentList "http://www.ourTestSite.com"

But that allows only to run one instance at a time … I’m searching for a way to run different instances OR end automatically a instance after a few minutes.

Can somebody help me please about that?

Thx!

Regards,
Chris

Chris,
Welcome to the forum. :wave:t4:

I’m not sure if I got what you’re actually asking. … if you have the names and passwords for your test users in a CSV file you can import these data with

and iterate over them either with

or

Hello Olaf,

no, that’s the point, there is only one Testaccount.
The users logon to the testsystem using their ActiveDirectory-account. Then they start the script, I posted, and it opens our Ticketsystem under the context of the testuser (everytime the same user) and they can create Tickets as this testuser.
The problem is, that there can only be one instance running under the testuser at same time. The script isn’t starting a second.
I’m searching for a way to handle that. One thought was, that the session is getting closed after a timeslot, e.g. 5 minutes or maybe, there’s a way to get several instances running at sime time.

Did I explain it clearly? please ask, if there’s any uncertainty.

Thx!

That sounds like a manual process anyway. Why do you need a script? And do you really have the password of the test user in your script in plain text?

That wouldn’t be a very common scenario anyway, or would it? One user usually uses only one instance at a time?! :man_shrugging:t4:

I still don’t get it. What difference would that be if you’re testing always with the same user?

Is the server able to handle multiple instances of the same user at the same time?? :thinking:

Not quite … sorry. :man_shrugging:t4:

Are there manual steps included where real users creating tickets in your system?
If “yes” why don’t you provide those users with the credentials of your test user?

The script is only to make it easier for the testers, so they don’t have to log in.
The example with the closing after 5 minutes reduces the probability, that two users would use the Ticket at the same time. The users often let the window stay open an forget closing it. Then the next user want to test an can’t open it.

Is the server able to handle multiple instances of the same user at the same time?? :thinking:

hm … how can I check this?

Wow. Really? What users are this … middle schoolers? :face_with_hand_over_mouth:

Mark Minasi used to say “there is no silicon based solution for a carbon based problem”. :man_shrugging:t4:

You logon to two computers at the same time and open your test web site … :man_shrugging:t4:

Just copy paste it beneath eachother… like…

Start-Process -FilePath $edge -Credential $cred -WorkingDirectory “C:\Windows” -ArgumentList “http://www.ourTestSite.com
Start-Process -FilePath $edge -Credential $cred -WorkingDirectory “C:\Windows” -ArgumentList “http://www.ourTestSite.com

It will open up 1 edge browser with 2 tabs if you copy paste it a third time and execute you will get 3 tabs.

If you want another user account just change the username/password and cred part.
You can use something like this…

$username02 = " testuser02"
$password02 = ConvertTo-SecureString -AsPlainText -Force “Test123333333”

$cred02 = New-Object System.Management.Automation.PSCredential -ArgumentList $username02, $password02

and then change

Start-Process -FilePath $edge -Credential $cred -WorkingDirectory “C:\Windows” -ArgumentList “http://www.ourTestSite.com

to

Start-Process -FilePath $edge -Credential $cred02 -WorkingDirectory “C:\Windows” -ArgumentList “http://www.ourTestSite.com