Hi,
Currently I am trying to automate games which are developed using Canvas tag.
This game has buttons like play, help etc which I want to automate.
Is there any possible way to automate these canvas elements using Katalon studio?
Sheetal
Hi,
Currently I am trying to automate games which are developed using Canvas tag.
This game has buttons like play, help etc which I want to automate.
Is there any possible way to automate these canvas elements using Katalon studio?
Sheetal
sheetal sulay said:
Hi,
Currently I am trying to automate games which are developed using Canvas tag.This game has buttons like play, help etc which I want to automate.
Is there any possible way to automate these canvas elements using Katalon studio?Sheetal
Anyone has any idea around this?
Sheetal
Not sure what is the question, but I will take a wild guess. Maybe try WebUI.switchToFrame() before working with canvas. Again, Iām not sure this will work, since I didnāt work with canvas, but hope it helps.
Thank you @Mate Mrse for responding.
Let me explain the issue.
I am doing game automation. The game in included withing single canvas element. So I am doing below to automate the game:-
WebUI.switchToFrame(findTestObject(āPage_GameLaunch/frm_Gameā),500)
WebUI.waitForElementVisible(findTestObject(āPage_GameLaunch/canvas_Gameā), 50)
WebUI.clickOffset(findTestObject(āPage_GameLaunch/canvas_Gameā),649,-166)
WebUI.clickOffset(findTestObject(āPage_GameLaunch/canvas_Gameā),666,384)
This is working fine.But this solution is not feasible as we have to find out the co-ordinates every time. So my question was to look for any other solution by which we do not need to provide co-ordinates for clicking.
Regards,
Sheetal
Sheetal,
Iām a step behind you on this, how can I pull the coordinates needed?
after that iām also going to be looking for a better solution.
Hi Anthony,
I used selenium recorder to get the desired co-ordinates.
Sheetal
**Working with Canvas in Edge browser
**I work with canvas in my application. Chrome browser click the middle of the canvas using the action āfocusā and ādoubleClickā. The doubleClick/click action brings a slider window as expected in Chrome. Whereas in Edge browser, the canvas is recognised as elementPresent == true, but the doubleClick does not show the slider window. The Katalon script result shows the doubleClick action as āpassā in Edge. But the slider window does not show up in the application. how to find in which coordinate, the script clicks on the canvas? Please assist. Thanks.
Hi Sheetal,
Did you found any better/feasible solution for this ?
Regards,
Abhishek
try to get size of the canvas i.e., height and width
height = WebUI.getElementHeight(findTestObject('Object Repository/##)
width = WebUI.getElementWidth(findTestObject('Object Repository/#pollafter that
WebUI.clickOffset(findTestObject(āPage_GameLaunch/canvas_Gameā),height1/5,width1/5)
if you want to do from centre than use 1/2
I hope my solution helps you