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.
Verify if an option exists in the drop down
We created a new option for our drop down. And we tried with the following codes, to verify if the created option exists in the drop down:
Option 1:assertTrue(browser.option(browser.select("Select_id"),"optionName").exists());
Option 2:assertTrue(browser.select("Select_id").containsText( "optionName"));
Both the options return false even if the option exists in the drop down
Any suggestions please.
Option 1:assertTrue(browser.option(browser.select("Select_id"),"optionName").exists());
Option 2:assertTrue(browser.select("Select_id").containsText( "optionName"));
Both the options return false even if the option exists in the drop down
Any suggestions please.
Comments
You will have to use the "in(ElementStub inEl)" method to specify that <option> should be searched in <select>.
Try this.
Regards,
dkulkarni