We started looking to replace iMacros and need some help with a link that works fine in iMacros and Selenium IDE, but does nothing in Ui.Vision even thou it seems to click the text correctly. I even imported the Solenium macro in Ui.Vision, but it still does not work. I cannot share the exact URL because it’s password secured. Here is Ui.Vision code that fails and the one from iMacros and Selenium IDE that work. I also tried using the XClick instead, but it did not work as well. Any help is appreciated:
Ui.Vision
{
"Command": "XClick",
"Target": "linkText=All",
"Value": "",
"Targets": [
"linkText=All",
"id=ctl00_contentPlaceHolderMain_lnkAll",
"xpath=//*[@id=\"ctl00_contentPlaceHolderMain_lnkAll\"]",
"xpath=//a[@id='ctl00_contentPlaceHolderMain_lnkAll']",
"xpath=//td/div/div/a",
"css=#ctl00_contentPlaceHolderMain_lnkAll"
],
"Description": ""
}
iMacros
FRAME NAME=main
TAG POS=1 TYPE=A ATTR=ID:ctl00_contentPlaceHolderMain_lnkAll
Selenium IDE
{
"id": "f8758db8-eb74-493e-999c-ab33d28acd7b",
"comment": "",
"command": "click",
"target": "id=ctl00_contentPlaceHolderMain_lnkAll",
"targets": [
["id=ctl00_contentPlaceHolderMain_lnkAll", "id"],
["linkText=All", "linkText"],
["css=#ctl00_contentPlaceHolderMain_lnkAll", "css:finder"],
["xpath=//a[contains(text(),'All')]", "xpath:link"],
["xpath=//a[@id='ctl00_contentPlaceHolderMain_lnkAll']", "xpath:attributes"],
["xpath=//div[@id='ctl00_contentPlaceHolderMain_pnlAll']/a", "xpath:idRelative"],
["xpath=//a[contains(@href, 'javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(\"ctl00$contentPlaceHolderMain$lnkAll\", \"\", true, \"\", \"\", false, true))')]", "xpath:href"],
["xpath=//td/div/div/a", "xpath:position"],
["xpath=//a[contains(.,'All')]", "xpath:innerText"]
],
"value": ""
}
Also, i just right clicked the link and here is the address it goes to, which is a javascript:
javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(“ctl00$contentPlaceHolderMain$lnkAll”, “”, true, “”, “”, false, true))
Update:
I was able to get it to work by adding the following step, but really wish there is a better way, why is not working without it?
{
"Command": "executeScript",
"Target": "WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(\"ctl00$contentPlaceHolderMain$lnkAll\",\"\", true, \"\", \"\", false, true))",
"Value": "",
"Description": ""
}