python - Selenium unique sessions -


i want use selenium on website. have open website multiple times simultaneously each instance having unique session. can open multiple windows can't seem create unique session each one.

i did research , found selenium grid , online platforms can run kinds of browsers test application seems more complicated has be.

so how can use selenium visit website multiple times simultaneously each 1 having unique session?

kind regards,

martin

i once answered similar question.

selenium runs private mode default. every time start driver via selenium creates brand new anonymous profile/session.

this means can instantiate multiple drivers, open multiple new windows , each of should not influenced others.

for instance code:

from selenium import webdriver import time  driver1 = webdriver.firefox() driver1.get("http://www.python.org") driver2 = webdriver.firefox() driver2.get("http://www.python.org") time.sleep( 20 ) 

will open 2 windows using different sessions. used sleep method, can see windows visually.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -