Radhika,

For point 3, refer below:

IWebElement fruits =browser.FindElement (By.XPath (".//*[@id='ddlFruits']"));

    fruits.Click();

    for (int i = 0; i < fruits.Options.Count; i++) {

        string fruitTobeSelected= fruits.Options [i].GetAttribute ("text");

        if (fruitTobeSelected.Contains ("Mango")) {

            fruits.Options [i].Click ();

            break;  

        }
    }

The above example is written in C#, you can try the same logic in :

In above example, we are looping through the options using its index and

checking if the text under a particular contains the value which we want to

select, and if the option contains that value, we are selecting that option.
In example we want to select fruit Mango from Fruits .



Source link https://sqa.stackexchange.com/questions/23622/--in---not--the--of-the-dropdown-fr

LEAVE A REPLY

Please enter your comment!
Please enter your name here