Hi. I am currently running several test using TP Agent, all running in a single browser window. For this particular case I need two separate browsers to run and interact with each other (one “student-browser” browser would simulate a student taking an exam and the oner one “proctor-browser” would simulate a proctor authorising and supervising the student). The flow implies the student asking for authorisation in student-browser, then the proctor confirming in proctor-browser. This interaction needs to be synced since the proctor needs to wait the student to ask for permission and then the student waits the proctor to grant it. Then the flow includes some other interactions between the two browser windows.
I was able to open a FF browser and a Chrome browser, each of them displaying different pages by using “vanilla” Selenium webdriver, but when I try to do the same with TP webdriver I get:
if BaseDriver.__instance is not None: raise SdkException("A driver session already exists") src.testproject.sdk.exceptions.sdkexception.SdkException: A driver session already exists
This is my initial sample code for managing more than one browser at a time:
def test_multiple_browsers(): ff_driver = webdriver.Firefox(token=settings.tp_token) ff_driver.report().disable_auto_test_reports(disabled=True) ff_driver.report().disable_command_reports(disabled=True) driver = webdriver.Chrome(token=settings.tp_token) driver.report().disable_auto_test_reports(disabled=True) driver.report().disable_command_reports(disabled=True) ff_driver.get("http://google.com") driver.get("http://yahoo.com")
Did anyone face this before? Any help would be more than appreciated.
Thanks in advance