"Browser is not opened" error on trying to switch to webview from Mobile application

i want to switch to webview from mobile application , perform some actions and switch back to Mobile app again . i am using “switchToWebView” and using webUI commands , but getting BrowserNotOpenedException: Browser is not opened.

=============== ROOT CAUSE =====================

Caused by: com.kms.katalon.core.webui.exception.BrowserNotOpenedException: Browser is not opened

For trouble shooting, please visit: https://docs.katalon.com/katalon-studio/docs/troubleshooting.html

================================================

10-16-2023 07:14:40 PM scrollToPosition(100, 200)

Elapsed time: 0.172s

Unable to scroll to position x = 100, y = 200 (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to scroll to position x = 100, y = 200

at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)

at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)

at com.kms.katalon.core.webui.keyword.builtin.ScrollToPositionKeyword.scrollToPosition(ScrollToPositionKeyword.groovy:85)

at com.kms.katalon.core.webui.keyword.builtin.ScrollToPositionKeyword.execute(ScrollToPositionKeyword.groovy:68)

at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)

at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.scrollToPosition(WebUiBuiltInKeywords.groovy:4495)

at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$scrollToPosition.call(Unknown Source)

at Invoices_PaymentFlow_Stripe.run(Invoices_PaymentFlow_Stripe:162)

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:448)

at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)

at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)

at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)

at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:144)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:135)

at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)

at TempTestCase1697463564725.run(TempTestCase1697463564725.groovy:25)

Caused by: com.kms.katalon.core.webui.exception.BrowserNotOpenedException: Browser is not opened

Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’

System info: host: ‘pruthvis-MacBook-Pro.local’, ip: ‘10.6.0.138’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘13.6’, java.version: ‘1.8.0_362’

Driver info: driver.version: unknown

at com.kms.katalon.core.webui.driver.DriverFactory.verifyWebDriverIsOpen(DriverFactory.java:1003)

at com.kms.katalon.core.webui.driver.DriverFactory.verifyWebDriver(DriverFactory.java:988)

at com.kms.katalon.core.webui.driver.DriverFactory.getWebDriver(DriverFactory.java:974)

at com.kms.katalon.core.webui.keyword.builtin.ScrollToPositionKeyword$_scrollToPosition_closure1.doCall(ScrollToPositionKeyword.groovy:83)

at com.kms.katalon.core.webui.keyword.builtin.ScrollToPositionKeyword$_scrollToPosition_closure1.call(ScrollToPositionKeyword.groovy)

at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)

at com.kms.katalon.core.webui.keyword.builtin.ScrollToPositionKeyword.scrollToPosition(ScrollToPositionKeyword.groovy:85)

at com.kms.katalon.core.webui.keyword.builtin.ScrollToPositionKeyword.execute(ScrollToPositionKeyword.groovy:68)

at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)

at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.scrollToPosition(WebUiBuiltInKeywords.groovy:4495)

at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$scrollToPosition.call(Unknown Source)

at Script1697263725229.run(Script1697263725229.groovy:162)

… 11 more

)

1 Like

Please update browser from katalon and try again

@pruthvi.gowda
correct me if I’m wrong

  1. you are trying to switch from a mobile application to a web Application on your pc?
    or
  2. you are trying to switch from the mobile browser to the mobile native application?

if your case is 1
you have to use the following

  1. specify the driver
  2. change the Driver in the DriverFactory
  3. you can use the Katalon WebUI Keywords
String driverpath=System.getProperty('user.dir')+"\\WebDriver\\chromedriver.exe"

System.setProperty('webdriver.chrome.driver', driverpath)

WebDriver driver = new ChromeDriver()

DriverFactory.changeWebDriver(driver)

driver.manage().window().maximize()

driver.get(GlobalVariable.appUrl)

Hi ,
I am trying to switch from Native mobile application on Android device to mobile browser .
Flow is something like.

  1. Copy url from mobile application
    2.open with chrome
  2. Do some web actions
    4.switch back to mobile application