How to verify availability of options in a Drop-Down field with CodedUI (C#)

It’s easy to get to know if particular option is available in drop-down field, as we just select that option and it verifies that…OK option is available. However if we want to verify that particular option is not available in some drop-down field then we need to think about some trick. One of trick is … Continue reading How to verify availability of options in a Drop-Down field with CodedUI (C#)

How to identify HtmlTag.A object with CodedUI (C#)

I invested many hours to find out that how we can identify class: ‘HtmlTag.A’ object? Eventually I have found that we can use ‘HtmlCustom’ class to identify ‘HtmlTag.A’ object. Below syntax will help to find it and click on it- HtmlCustom Tab = new HtmlCustom(browser); Tab.SearchProperties.Add(“InnerText”, “ManageUser”, “TagName”, “A”); Mouse.Click(Tab); Provide your comment if it is not working in … Continue reading How to identify HtmlTag.A object with CodedUI (C#)

How to select date from calendar in CodedUI (C#)

If you have calendar which have Month and Year drop-downs and date in tags then follow below code to select the date from the calendar HtmlImage calImage = new HtmlImage(browser); cal.SearchProperties.Add(“Id”, “ImageID”); //It finds the ‘V’ image of calendar to open. Mouse.Click(cal); //It opens the calender. HtmlComboBox Month = new HtmlComboBox (browser); Month.SearchProperties.Add(“Id”, “MonthDropDownID”); //It … Continue reading How to select date from calendar in CodedUI (C#)

How to select drop-down value in CodedUI (C#)

Below code will help to select values in drop-down field- HtmlComboBox State = new HtmlComboBox(browser); State.SearchProperties.Add(“Id”, “State”); State.SetProperty(“SelectedItem”, “Assam”); State.SetProperty(“SelectedItem”, “Goa”); If you want to get by default selected value from Drop-Down field then use below method to get that- String Default=State.SelectedItem.ToString(); Console.WriteLine(Default);