1

We use Telerik RadComboBox to implmement a drop-down list in our web application. Is it possible to use the Selenium command verifySelectOptions to validate only if specific values are present in the drop-down list?

I'm trying to use it but I get this error message:

[error] Unexpected Exception: fileName -> chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js, lineNumber -> 1688, columnNumber -> 20

Does anyone have succeeded in using verifySelectOptions command to validate a drop-down list with RadComboBox control?

PS: my purpose is to validate whether the drop-down list is displayed well as a defined list, not displayed as a non-defined list.

Thank you.

Ross Patterson
  • 9,527
  • 33
  • 48
  • I have an issue with rcbHoevered. how do you get the drop down to appear and selec the item. I am entering the text with "type', but the drop down doesn;t appear – mark1234 Jul 17 '17 at 12:12

1 Answers1

0

You are recieving that error because your Selenium IDE doesn't appear to be properly set up.

But onto the issue at hand - verifySelectOptions won't work because RadComboBox is not your typical dropdown.

verifySelectOptions scans a <select> for options, then compares the subsequent <option>'s in that select.

The RadComboBox is a custom control, made to look like a combo box, and (from what i've seen so far) is a <table>.

So onto the solution...
From a quick peak here, i can see that there are a few core fundamentals to the RadComboBox. First, is that inside the HTML heirarchy, there lies an <input id="someIDHere...">

We can use this ID for the Second fundamental.

The second, is that under the <form> which your boxes are under, there is a div with that SAME ID, but instead of ending with <input id="someIDHere_..._Input">, it ends with <div id="SAMEIDHERE_<samestuffhere>_DropDown">. So your goal is to find those ID's, then find that list. Once you have those, you can go to town...

Using Selenium IDE...
On your IDE, you can use selectors to simply make sure that the options are there. For example -
mind what I said about the ID.

Also if you look at the dropdown itself - that's how you retrieve the ID. (note that itends with _Input instead of _DropDown)

You cannot read the IDE, so i'll show you the selectors you should have. css=div#<THE_ID>_DropDown ul > li[innerHTML='<whatever the text should be>'] And just verify that those elements are present by using the IDE, verifyElementPresentcommand.

ddavison
  • 28,221
  • 15
  • 85
  • 110
  • Thank you for your information. BTW, do you know how to count li element? as I need know how many list display in drop down list. I try to use storeXpathCount, but always get return 0. Command: storeXpathCount Target: //div[@id="ddlStatus_Input"]/ul/li Value: counter – user1929542 Dec 27 '12 at 02:51
    • New
    • Open
    • More Info
    – user1929542 Dec 27 '12 at 02:52