Forum Discussion
rraghvani
Champion Level 3
Here's a few examples of using XPath to highlight the control not using full id name,
function test1()
{
// URL https://www.w3schools.com/html/tryit.asp?filename=tryhtml_id_css
var page = Aliases.browser.Page("https://www.w3schools.com/html/tryit.asp?filename=tryhtml_id_css").FindElement("#iframeResult");
var item = page.FindElement("//*[@id='myHeader']");
Sys.HighlightObject(item);
var item = page.FindElement("//*[@id[starts-with(., 'my') and string-length() > 3]]");
Sys.HighlightObject(item);
var item = page.FindElement("//*[starts-with(@id, 'my')]")
Sys.HighlightObject(item);
}
MarcusBengtsson
2 years agoFrequent Contributor
Hmm thank you for the reply and help I will try to figure something out for the keyword tests out from this 😮
Related Content
- 7 years ago
- 6 years ago
- 5 years ago
- 2 years ago
Recent Discussions
- 20 hours ago
- 20 hours ago
- 5 days ago