Hi all
I am new to Kantu and am not a programmer by any chance.
I have a very simple set of instructions that I want Kantu to perform.
It keeps stopping on the one command as if it could not find the button/element.
"Command": "clickAndWait",
"Target": "//*[@id=\"ajaxcontent\"]/fieldset[2]/table/tbody/tr[3]/td[3]/table/tbody/tr[5]/th/a/span",
"Value": ""
Basically it is the 15th button in a set of “identical” buttons.
There are 2 x “fieldset” and I did try to record a macro by clicking on a similar button in the 1st group and the only difference was it was " fieldset[1]", the rest was the same.
“Command”: “clickAndWait”,
“Target”: “//*[@id=“ajaxcontent”]/fieldset[1]/table/tbody/tr[3]/td[3]/table/tbody/tr[5]/th/a/span”,
“Value”: “”
All the text for the button is the same only the “onclick” is different.
I did google and tried this:
“Command”: “clickAndWait”,
“Target”:WebElement button = driver.findElements(By.cssSelector(“button[title=Attack this enemy now!][onclick*=fight?enemy=53]”))
I did inspect the button and it came up with this.
onclick=“l(“fight?enemy=53&friend=0&s=cc19f”,null,null,true)” class=“button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only” style=“color:black” role=“button”>Attack this enemy now!
I also tried xpath=(//a[contains(@class, ‘Attack this enemy now!’)])[15]
Can you please advise me if my syntax or command is correct.
In iMacros all it did was click on the 15th button with that text.
Is there is an equivalent command for this in Kantu?
Thank you
Ken