Warning: fopen(/tmp/SghXTngBZPli-xVjxgG.tmp): failed to open stream: Disk quota exceeded in /home/executea/public_html/blog/wp-admin/includes/class-wp-filesystem-ftpext.php on line 139

Warning: unlink(/tmp/SghXTngBZPli-xVjxgG.tmp): No such file or directory in /home/executea/public_html/blog/wp-admin/includes/class-wp-filesystem-ftpext.php on line 142
Site Loader
Auckland, New Zealand
In Selenium there is nothing called WebCombo or WebList class available to select the list box and combo box, every control in UI is called as WebElement, hence to select a combo box or list box from the page we can do in selenium using SelectElement class, which is available under using OpenQA.Selenium.Support.UI namespace. First create an instance of the SelectElement class and then using SelectByText method, select the text from the drop down list box. Here is the code snippet to do so.
SelectElement element = new SelectElement(control);
element.SelectByText(ValueToSelect);
This will now select the drop down or list box value from the UI of the page. Thanks, Karthik KK

Post Author: Karthik kk

One Reply to “Selecting a drop down and list box using selenium”

Leave a Reply

Your email address will not be published. Required fields are marked *