This is a migrated thread and some comments may be shown as answers.

[Solved] Getting a RadcomboBoxItem by selected Text

1 Answer 13 Views
Telerik Testing Framework
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mona
Top achievements
Rank 1
Mona asked on 14 Jan 2010, 11:57 PM

How to get a selected text for radComboBoxItem.

This is what I am trying in my code

My Code start here....

 

 

OracleConnection cn = new OracleConnection(Blah Blah);
cn.Open();

 

 

OracleCommand cm = cn.CreateCommand();

 

cm.CommandType = System.Data.

CommandType.Text;

 

cm.CommandText =

@"select max(dismantlermainid) from dismantlermain where statuscode = 1101435

 

and dismantlermainid in (select dismantlermainid from dismantler group by dismantlermainid

having count(*) > 2)"

;

 

 

string maxdismantlermainid = cm.ExecuteScalar().ToString();

 

cm.CommandText =

@"select nameid,name from dismantlermain where dismantlermainid = " + maxdismantlermainid;

 

 

OracleDataReader dr = cm.ExecuteReader();

 

dr.Read();

 

string listItem = dr.GetString(0) + " - " + dr.GetString(1);

 

RadComboBoxItem comboItem1 = Pages.Dismantler_Maintenance_Lookup_0.div_ContentPlac_DismantlerMains.FindItemByText(listItem);

 

comboItem.Wait.ForExists(10000);

comboItem.Select();

 

}

1 Answer, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 15 Jan 2010, 02:01 AM
Hi Mona,

Once you select a ComboBoxItem, you can easily get the ComboBox text and verify it. You can either obtain the value programmatically like myCombo.Text or use the WebUI Test Studio automation surface to highlight the ComboBox control and get its verifications/select the .Text one. In WebUI Test Studio v1.1 you need to right-click on the element to get its menu and in v2.0 just hover over that element for a second and the menu will popup.

I hope this information helps.

Kind regards,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Telerik Testing Framework
Asked by
Mona
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
Share this question
or