Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, windows and java based applications. Get your 30 day free trial.
Discuss your Sahi Pro usage patterns, best practices, problems and solutions. Help others solve their problems and seek help from the community when needed. If you need specific support on your application, please email support @ sahipro.com
Discuss your Sahi Pro usage patterns, best practices, problems and solutions. Help others solve their problems and seek help from the community when needed. If you need specific support on your application, please email support @ sahipro.com
Verify if an option exists in the drop down
viswa
Members
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