WebDriver and ExtJS generated Combo box

1,189 views
Skip to first unread message

DonJay

unread,
Oct 3, 2011, 7:11:53 AM10/3/11
to Selenium Users
Dear All,

I have a javascript generated combo box using ExtJS that has the id
"status". In Selenium 1, I used to select an item on this combo box
list with:

selenium.runScript(selenium.getEval("this.browserbot.getCurrentWindow().document.getElementById('status').value
= '1'; "));

In Selenium 2, I used the following code below and got an error:

Select dropDownListBox = new
Select(driver.findElement(By.id("status")));
dropDownListBox.selectByValue("1");

The error is:
org.openqa.selenium.support.ui.UnexpectedTagNameException: Element
should have been "select" but was "input"

Using firepath to see part of the html code gave the following:
<input id="status" type="hidden" name="status" value="1">
<input type="text" autocomplete="off" size="24" id="ext-gen91"
class="x-form-text x-form-field x-form-focus" style="width: 101px;
position: relative;">

And for the combo lists the following (The selected value - "Not
Applicable" has the value 1);
<div class="x-combo-list-inner" id="ext-gen177" style="width: 127px;
height: 120px;">
<div class="x-combo-list-item ">No data</div>
<div class="x-combo-list-item">Single</div>
<div class="x-combo-list-item">Divorced</div>
<div class="x-combo-list-item ">Married</div>
<div class="x-combo-list-item ">Engaged</div>
<div class="x-combo-list-item x-combo-selected">Not Applicable</div>
</div>

Please any help or ideas on how to solve this? The system information
is - {Selenium-server-standalone-2.7.0, Java-6, Linux platform,
Firefox3}

Regards,

Donjay




Hema

unread,
Nov 15, 2012, 2:17:38 AM11/15/12
to seleniu...@googlegroups.com
Hi All,

I am facing the same issue as the user Donjay wherein I get the error as 'Element should have been "select" but was "input"'. Though it is a pretty old thread, any responses for this would be much appreciated.

Please advise.

Thanks,
Hema

Mark Collin

unread,
Nov 15, 2012, 4:31:59 PM11/15/12
to seleniu...@googlegroups.com

Sounds like you are trying to create a Select object using an <input> element which wont work

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/oL9DeB2ems8J.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ram Maram

unread,
Nov 15, 2012, 11:22:51 PM11/15/12
to seleniu...@googlegroups.com

Hi Hema,

 i am also working on extjs application, i observed that some methods are not working directly

like select(), isChecked(), isSelecetd() etc.
so we have to manage those methods, for select method in extjs dropdowns are having tags xpath with div or input,not select tag


Thanks,
Ram.

Nathan Dace

unread,
Nov 16, 2012, 1:16:45 AM11/16/12
to seleniu...@googlegroups.com
Ext Js combo boxes are not real combo boxes. They are a text field with an image next to it, which when clicked displays the option list. You will need to click on the image and then click on the option you need to select.
Reply all
Reply to author
Forward
0 new messages