My Code Snippet:
storeXPath property: "linkHref", propertyType: "ant", xpath: "//a...@name =
'viewLive']/@href", default: "EMPTY"
invoke '${linkHref}'
def str = '${linkHref}'
echo 'String value::::'+'${linkHref}'
echo 'variable value::::'+str
echo -----+str.indexOf(?)
I am getting following Output:
[java] [echo] String
value::::http://nitra.test-dealer.com.websites.dev-gparesh.blr.main.cobaltgroup.com/selenium/?reload=true
[java] [echo] variable
value::::http://nitra.test-dealer.com.websites.dev-gparesh.blr.main.cobaltgroup.com/selenium/?reload=true
[java] [echo] ----- -1
I want the index of ? character from the url i.e
http://nitra.test-dealer.com.websites.dev-gparesh.blr.main.cobaltgroup.com/selenium/?reload=true.
To get the index, I m using indexOf(?) to get the index of ?. But its
always giving -1.
Is the way of assigning of webtest property "${linkHref"} to groovy variable
"str" is correct?
Need help to re-solve this issue.
Thanks in Advance.