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.
How to select a drop down item which contains a substring
Hello,
I would like to know how to select the first item in a drop down list which contains the supplied text.
for example...if my list box contains the following entries...
first entry
second entry
3rd entry
4th entry
5th entry
I would like to pass only the text "th" and have the value set to "4th entry".
Thanks,
Eric.
I would like to know how to select the first item in a drop down list which contains the supplied text.
for example...if my list box contains the following entries...
first entry
second entry
3rd entry
4th entry
5th entry
I would like to pass only the text "th" and have the value set to "4th entry".
Thanks,
Eric.
This discussion has been closed.
Comments
What if I want to pass the value in a variable?
I've tried the following plus another couple of variants with no success.
var $test = "th";
_setSelected(_select("id"), /$test/)
Thanks,
Eric.
var $test = "th";
_setSelected(_select("country"),RegExp($test.replace(/\s+$/, '')));