Iframe Issue when using Katalon through automate.browserstack

So I have done a search and couldnt see anything similar (and ive done a lot of searching today).

I am automating a journey through broswerstack, which uses the URL of https://automate.browserstack.com/ however I have come across an Iframe Issue which I cant resolve (Ill be honest, Im not sure if it can be resolved). I have a payment page that when I ask Katalon to click on a button (Its a visa Button) it gives me an error. Caused by: org.openqa.selenium.WebDriverException: Appium error: An unknown server-side error occurred while processing the command. Original error: Blocked a frame with origin “https://xxxxxxxxxxx” from accessing a cross-origin frame. Protocols, domains, and ports must match. (WARNING: The server did not provide any stacktrace information)

For trouble shooting, please visit: https://docs.katalon.com/katalon-studio/docs/troubleshooting.html
I have used switch to frame, scroll to element (we thought it couldnt find the button) ive put in delays, but it just cant click on it.
Here is the error
Caused by: org.openqa.selenium.WebDriverException: Appium error: An unknown server-side error occurred while processing the command. Original error: Blocked a frame with origin “https: xxxxxx” from accessing a cross-origin frame. Protocols, domains, and ports must match. (WARNING: The server did not provide any stacktrace information)

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

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

11-10-2022 03:56:24 PM click(findTestObject(“Mobile/Page_ReviewAndPay/Visa mobile”))

Elapsed time: 0.684s

Unable to click on object ‘Object Repository/Mobile/Page_ReviewAndPay/Visa mobile’ (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to click on object ‘Object Repository/Mobile/Page_ReviewAndPay/Visa mobile’

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.ClickKeyword.click(ClickKeyword.groovy:74)

at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:40)

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

at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:620)

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

at Deposit and full payment Mobile.run(Deposit and full payment Mobile:28)

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

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.doCall(CallTestCaseKeyword.groovy:59)

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.call(CallTestCaseKeyword.groovy)

at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:74)

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.callTestCase(CallTestCaseKeyword.groovy:81)

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.execute(CallTestCaseKeyword.groovy:44)

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

at com.kms.katalon.core.keyword.BuiltinKeywords.callTestCase(BuiltinKeywords.groovy:334)

at Mobile Cruise.run(Mobile Cruise:51)

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

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

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

at TempTestCase1668095447507.run(TempTestCase1668095447507.groovy:25)

Caused by: org.openqa.selenium.WebDriverException: Appium error: An unknown server-side error occurred while processing the command. Original error: Blocked a frame with origin “https://xxxxx” from accessing a cross-origin frame. Protocols, domains, and ports must match. (WARNING: The server did not provide any stacktrace information)

Command duration or timeout: 0 milliseconds

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

System info: host: ‘F34VCL3’, ip: ‘172.25.196.92’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_282’

Driver info: io.appium.java_client.ios.IOSDriver

Capabilities {64bit: false, Build: 2UAT Ocean Cruise 1, acceptSslCert: false, acceptSslCerts: false, automationName: XCUITest, bootstrapPath: /usr/local/.browserstack/co…, browser: iphone, browserName: safari, browser_name: Safari, browserstack-tunnel: true, browserstack.appium_version: 1.21.0, browserstack.isTargetBased: true, browserstack.is_hub_canary: false, capabilities: {64bit: false, Build: 2UAT Ocean Cruise 1, acceptSslCert: false, acceptSslCerts: false, automationName: XCUITest, bootstrapPath: /usr/local/.browserstack/co…, browser: iphone, browserName: safari, browser_name: Safari, browserstack-tunnel: true, browserstack.appium_version: 1.21.0, browserstack.isTargetBased: true, browserstack.is_hub_canary: false, custom_replay_kit_params: {“rotation”:“false”,"captur…, databaseEnabled: false, detected_language: selenium/3.141.59 (java win…, device: iphone, deviceName: iPhone 14, deviceOrientation: PORTRAIT, javascriptEnabled: true, locationContextEnabled: false, mobile: {browser: mobile, version: iPhone 14-16.0}, networkConnectionEnabled: false, newCommandTimeout: 0, new_bucketing: true, noReset: true, orientation: PORTRAIT, orig_os: ios, osVersion: 16, os_version: 16.0, platform: MAC, platformName: iOS, projectName: Rebrand, realMobile: true, real_mobile: true, safariIgnoreFraudWarning: true, safariInitialUrl: http://mobile-internet-chec…, sessionId: a617814510b4da5168f92c19502…, sessionName: Test for rebrand complete b…, takesScreenshot: true, udid: 00008110-001C5C4A0E41401E, useXctestrunFile: true, version: , wda_port: 8406, webStorageEnabled: false, webkitResponseTimeout: 20000}, custom_replay_kit_params: {“rotation”:“false”,"captur…, databaseEnabled: false, detected_language: selenium/3.141.59 (java win…, device: iphone, deviceName: iPhone 14, deviceOrientation: PORTRAIT, javascriptEnabled: true, locationContextEnabled: false, mobile: {browser: mobile, version: iPhone 14-16.0}, networkConnectionEnabled: false, newCommandTimeout: 0, new_bucketing: true, noReset: true, orientation: PORTRAIT, orig_os: ios, osVersion: 16, os_version: 16.0, platform: MAC, platformName: iOS, projectName: Rebrand, realMobile: true, real_mobile: true, safariIgnoreFraudWarning: true, safariInitialUrl: http://mobile-internet-chec…, sessionId: a617814510b4da5168f92c19502…, sessionName: Test for rebrand complete b…, takesScreenshot: true, udid: 00008110-001C5C4A0E41401E, useXctestrunFile: true, version: , wda_port: 8406, webStorageEnabled: false, webkitResponseTimeout: 20000}

Session ID: a617814510b4da5168f92c1950218c020c478101

at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)

at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)

at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:40)

at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:80)

at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:44)

at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)

at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)

at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)

at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)

at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)

at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)

at org.openqa.selenium.remote.RemoteWebDriver$RemoteTargetLocator.frame(RemoteWebDriver.java:892)

at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringTargetLocator.frame(EventFiringWebDriver.java:707)

at com.kms.katalon.core.webui.common.WebUiCommonHelper.switchToParentFrame(WebUiCommonHelper.java:1440)

at com.kms.katalon.core.webui.common.WebUiCommonHelper.switchToParentFrame(WebUiCommonHelper.java:1425)

at com.kms.katalon.core.webui.common.WebUiCommonHelper.switchToParentFrame(WebUiCommonHelper.java:1447)

at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.doCall(ClickKeyword.groovy:63)

at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.call(ClickKeyword.groovy)

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

at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.click(ClickKeyword.groovy:74)

at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:40)

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

at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:620)

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

at Script1668017501486.run(Script1668017501486.groovy:28)

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

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.doCall(CallTestCaseKeyword.groovy:59)

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.call(CallTestCaseKeyword.groovy)

at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:74)

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.callTestCase(CallTestCaseKeyword.groovy:81)

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.execute(CallTestCaseKeyword.groovy:44)

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

at com.kms.katalon.core.keyword.BuiltinKeywords.callTestCase(BuiltinKeywords.groovy:334)

at Script1667811311726.run(Script1667811311726.groovy:51)

… 11 more

)

and this is the script
not_run: WebUI.switchToFrame(findTestObject(‘Mobile/Page_ReviewAndPay/Iframe mobile’), 10)

not_run: WebUI.scrollToElement(findTestObject(‘Mobile/Page_ReviewAndPay/Visa mobile’), 0)

WebUI.click(findTestObject(‘Mobile/Page_ReviewAndPay/Visa mobile’))

WebUI.setText(findTestObject(‘Mobile/Page_ReviewAndPay/Card number mobile’), GlobalVariable.CardNumber)

WebUI.selectOptionByIndex(findTestObject(‘Mobile/Page_ReviewAndPay/Month mobile’), ‘1’, FailureHandling.STOP_ON_FAILURE)

WebUI.selectOptionByIndex(findTestObject(‘Mobile/Page_ReviewAndPay/year Mobile’), ‘3’)

WebUI.setText(findTestObject(‘Mobile/Page_ReviewAndPay/CV Number Mobile’), ‘222’, FailureHandling.STOP_ON_FAILURE)

WebUI.click(findTestObject(‘Mobile/Page_ReviewAndPay/Pay button mobile’))

I think there could be a workaround (taking the URL directly and opening it with a step that way) but its not ideal. Has anybody come across this and resolved it?

Let me reach out to see if anyone internally can assist with this.
Best, Sara

1 Like

Hi @lisa.s,

After investigating your issue, this is an error raised by Appium that it cannot access controls with some platforms. I would like to suggest you the following ways to troubleshoot it:

  1. If you are using iOS Safari, you can retrieve the iframe element’s “src” URL (suggested from this post) then you can set the test to directly click on that URL. (Reference how to get iframe “src” URL)

  2. If you are using Web Platform (Chrome, etc), the solution can be found here. The way is also similar to that of iOS but to copy element XPATH.

Hope these suggestions can deal with your problem. Please feel free to reach us if more questions. Thank you!

2 Likes

Thanks for the update, im not quite sure if that will work for the testing that I am doing, as that is a “workaround” that we had found. We figured it was because it could be a security issue However, I will have to try it and see what it does if that is going to be the only way that I am able to test this particular page.

Once again, thank you for your help :smiley:

1 Like