TryFindSingle case insensitive
Posted: Mon Apr 30, 2012 3:00 pm
I am trying to use the path below to find a matching username but it is not being found.
string XPath_to_find_user = ".//td[@innertext~'(?i:"+ User_name) +")']";
if(User_table.TryFindSingle<TdTag>(XPath_to_find_user,30000, out Found))
{
Found.Click();
}
If I try the same path in the Spy it works perfectly and quite quickly.
If I take out the case insensitive bit and search for:
string XPath_to_find_user = ".//td[@innertext='" + User_name + "']";
it works perfectly. So there must be some problem with the case insensitive bit?
string XPath_to_find_user = ".//td[@innertext~'(?i:"+ User_name) +")']";
if(User_table.TryFindSingle<TdTag>(XPath_to_find_user,30000, out Found))
{
Found.Click();
}
If I try the same path in the Spy it works perfectly and quite quickly.
If I take out the case insensitive bit and search for:
string XPath_to_find_user = ".//td[@innertext='" + User_name + "']";
it works perfectly. So there must be some problem with the case insensitive bit?