Unable to click the object while executing via browser stack

Dear,
I launched the edge browser with browser stack, but i always get an error that object cannot be clicked.

Error given below, Can someone please help ???

Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to click on object ‘Object Repository/POC_PG_OBJ/Page_Events/button_Play Video’
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:86)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:67)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:616)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$2.call(Unknown Source)
at VOD_TOS_User changes the quality of the video.run(VOD_TOS_User changes the quality of the video:23)
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 TempTestCase1562080051069.run(TempTestCase1562080051069.groovy:21)
Caused by: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/POC_PG_OBJ/Page_Events/button_Play Video’ located by 'By.xpath: //button[(text() = 'Play Video

’ or . = 'Play Video

‘)]’ not found
at com.kms.katalon.core.webui.common.WebUiCommonHelper.findWebElement(WebUiCommonHelper.java:1097)
at com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword.findWebElement(WebUIAbstractKeyword.groovy:27)
at com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword.findWebElement(WebUIAbstractKeyword.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.doCall(ClickKeyword.groovy:77)
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)
… 17 more

My advice: find/create a better xpath because that one is not working.

@Russ_Thomas But the same works for me in local browsers like chrome , fr, ie. the issue is only when I connect to browser stack and execute the scripts remotely since katalon is not supporting edge or safari directly,. Is there a solution?

One way to isolate the problem is that you actually use the XPath above to inspect the element on Safari ( I mean your browser, not web driver) . If the element is found using the XPath above then the problem lies elsewhere. Otherwise it may have been due to some peculiar stuffs happening on your website on Safari specifically.

Cheers !

1 Like

Hard to say. Katalon is reporting the element does not exist. Have you tried waiting longer?

Are you able to do a live session with browserstack and verify that the element can be found using that xpath?

Personally I try to stay away from finding elements by their text. Sometimes they work ok but usually there is some formatting or whitespace issue I run into where it can’t find it.

Agreed. It’s the text that is most likely to change over time. Best avoided.

1 Like

Dears @ThanhTo , @Russ_Thomas, @Eric_Montou the same script works for chrome , Firefox and IE. I also use the auto heal xpAth… so normally I guess this should work in browser stack as well … is there a way to launch live browserstack without remote ???

Dears @ThanhTo , @Russ_Thomas, @Eric_Montou I think i got the issue the X-path is working fine.
The issue is when I launch the browser in browserstack edge 17 the page page is blank … [attached screen print for ref] , can someone help on this to see what has gone wrong ??

If the page isn’t being rendered, your problem seems to be with browserstack.

When you say the scripts are working for chrome, are you saying they work with chrome while using browserstack?

It looks to me like you are trying to access a local url with browserstack. In this case, none of the browsers would be working. Try something public first like google.com to see if that works. If that works with browserstack then the next step would be trying to figure out how browserstack can access whatever environment you are trying to test.

I ran into this issue with browserstack recently. Our QA environment is not public and requires credentials to access. We got it to work though.

1 Like