18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
Query regarding "containsHTML" and "containsText"
Hi All,
Is containsHTML and "containsText" search "case sensitive"?
If yes, What do i have to do if i want a case insensitive search??
Thanking in advance!!
Regards
Akshada
Is containsHTML and "containsText" search "case sensitive"?
If yes, What do i have to do if i want a case insensitive search??
Thanking in advance!!
Regards
Akshada
This discussion has been closed.
Comments
Yes, "_containsHTML" and "_containsText" are case sensitive.
You can make them case insensitive by using:
_containsText(element,/text/i);
Regards
Sumitra
Please let me know the equivalent Java code for "_containsText(element,/text/i); "
Thank you so much for the prompt reply!!
Regards
Akshada
This is the equivalent:
dkulkarni
Here I am storing the text in String str!!
So how do i write it??
I cant wirte it as "browser.element.containsHTML("/str/i");"
Thanks for the reply!!
Regards
Akshada
You essentially need to pass a regular expression here. So you can either use:
browser.element.containsHTML("/" + str + "/i");
or
String expr = "/" + str + "/i";
browser.element.containsHTML(expr);
Regards,
dkulkarni
That worked!! All sorted now...
Thanks a lot!!
Regards,
Akshada