I’m actually able to do it. Only problem I’m getting is to execute this script. So, if I execute this in console of devtools then semantics gets visible on flutter web app. I just need to find a way to execute this script via Katalon Studio.
This is what I was thinking that something is wrong with my syntax. I have attached script as well as javascript executor input option. Can you please guide me what’s the right way to put it there?
I would show you an runnable example Test Case script that calls WebUI.executeJavascript() keyword. Copy&paste the following as a new Test Case in your Katalon Studio and run it. It should work.
I used the Katalon’s site http://demoaut.katalon.com as a target. You would want to change the target URL and the javascript code as you want. Please try it for yourself.
You haven’t shared the URL of your target, so that others in this forum would not be able to do any more.
If you want to use javascript to do something I think there are 2 ways
1 Use the keyword of katalon:
WebUI.executeJavaScript(“document.querySelector(‘flt-glass-pane’).shadowRoot.querySelector(‘flt-semantics-placeholder’).click()”, null);
2 Write a function in java and execute javascript (in fact, it is the same as katalon’s method, which calls selenium native methods).
public void executJS(String js) {
((JavascriptExecutor)driver).executeScript(js);
}