I am attempting to use xpath to click on desired buttons via a windows application.
I don’t have any problems clicking on them as a direct call to the button as stored in the object repository.
The application has multiple panels like the image below, and I want to be able to select the panel and button to click using the xpath. I’m doing something wrong and would like to correct that.
I was trying: Windows.click(findWindowsObject(By.xpath(“//Window//Pane[1]//Tab[1]//TabItem[1]//Pane[1]//Pane[1]//Button[11]”)))
The goal is to replace the last Pane and Button int with a variable once I can get the xpath syntax figured out.
The error I’m getting for that is:
Test Cases/Test FAILED.
Reason:
groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject() is applicable for argument types: (org.openqa.selenium.By$ByXPath) values: [By.xpath: //Window//Pane[1]//Tab[1]//TabItem[1]//Pane[1]//Pane[1]//Button[11]]
Possible solutions: findWindowsObject(java.lang.String), findWindowsObject(java.lang.String, java.util.Map)
at preset.Conf.SelectStation(Conf.groovy:132)
at preset.Conf$SelectStation.call(Unknown Source)
at Test.run(Test:15)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)