Closed yan0lovesha closed 6 years ago
I think it would work with '|' but it won't work with '.' because a period is class in a CSS selector.
canopy attempts several selector types:
yield findByCss cssSelector f
yield findByValue cssSelector f
yield findByXpath cssSelector f
yield findByLabel cssSelector f
yield findByText cssSelector f
yield findByJQuery cssSelector f
yield findByNormalizeSpaceText cssSelector f
Your selector would be treated like this when run as a css selector
find element with id of systemuser|systemuser
with immediate child of class PromoteToAdmin
You can add the By.Id to the list of things that canopy will automatically look for like this (put this in your setup code, around where you start a browser or change configurations)
let findById id f =
try
f(By.Id(id)) |> List.ofSeq
with | ex -> []
addFinder findById
Hope this helps!
If an element id contains some special characters like '|' or '.', the element and elements function cannot find it.
Example:
I didn't test other characters. There may be other letters also has this problem.