I need to create a test case that includes two different browser instances and I have created 2 different browser instances.
I have opened the first browser instance and done some log in into the website and I have done similar steps in the other browser instance and now I need to switch to first browser instance and need to perform some actions and I was using this command
DriverFactory.changeWebDriver(driver1)
But it was throwing this error
Test Cases/2 browsers FAILED.
Reason:
org.openqa.selenium.NoSuchSessionException: Session ID is null. Using WebDriver after calling quit()?
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:125)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteTimeouts.implicitlyWait(RemoteWebDriver.java:780)
at com.kms.katalon.core.webui.driver.DriverFactory.setTimeout(DriverFactory.java:821)
at com.kms.katalon.core.webui.driver.DriverFactory.changeWebDriverWithoutLog(DriverFactory.java:267)
at com.kms.katalon.core.webui.driver.DriverFactory.changeWebDriver(DriverFactory.java:259)
at com.kms.katalon.core.webui.driver.DriverFactory$changeWebDriver$0.call(Unknown Source)
at 2 browsers.run(2 browsers:134)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1588052554411.run(TempTestCase1588052554411.groovy:25)
Can anyone help me how to overcome this issue and how to switch between differnt browser instances in the test case.
Thanks.