Hi,
I’ve got a simple web page with a couple of buttons in a box. These buttons change their text when they are clicked as they have different context based uses.
They start as “edit” and “clear”. If “edit” is pressed they change to “cancel” and “apply”. Clicking “cancel” or “apply” returns the buttons to the original values, but “apply” also performs a POST command.
I’ve got the following test script to click the “edit” button and then click the “apply” button in a loop.
{
“Name”: “Untitled”,
“CreationDate”: “2019-3-7”,
“Commands”: [
{
“Command”: “open”,
“Target”: “http:”,
“Value”: “”
},
{
“Command”: “store”,
“Target”: “1”,
“Value”: “loopcounter”
},
{
“Command”: “while”,
“Target”: “({loopcounter} <= 10)",
"Value": ""
},
{
"Command": "click",
"Target": "//*[@id=\"button-box\"]/button[contains(text(),'edit')]",
"Value": ""
},
{
"Command": "click",
"Target": "//*[@id=\"button-box\"]/button[contains(text(),'apply')]",
"Value": ""
},
{
"Command": "storeEval",
"Target": "{loopcounter}+1”,
“Value”: “loopcounter”
},
{
“Command”: “endWhile”,
“Target”: “”,
“Value”: “”
}
]
}
The clicking of the “edit” button works as expected, but the “apply” doesn’t do anything (but I can see on the screen the button go green as if it has been clicked) and the loop fails next time round because the “edit” button is no longer available.
I’ve tried the latest Chrome and Firefox browsers with the same results.
Any help is greatly appreciated.
Thanks in advance
Adrian