Unable to select Dojo ComboBox value Using Selenium

1,564 views
Skip to first unread message

Pavan Kumar Chennam

unread,
Oct 24, 2011, 1:19:26 PM10/24/11
to seleniu...@googlegroups.com
Hi ,

I'm Unable to select value from Dojo Select box using Selenium. Could any one Please help on this Issue

Please find the Url for this which i'm trying : http://demos.dojotoolkit.org/demos/form/

I want to select "State"  in the above Page Using Selenium RC

--
Thanks ,
Pavan Chennam
Test Automation Engineer

Ambika Rajagopalan

unread,
Oct 24, 2011, 1:44:37 PM10/24/11
to seleniu...@googlegroups.com
in selenium RC the command is selenium.select (" locator", "label = value ");

if the page is taking time to load, you can use selenium.getSelectOptions(" locator");

Thanks.

--
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.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

bis

unread,
Oct 24, 2011, 2:07:58 PM10/24/11
to seleniu...@googlegroups.com
to me trying to figure out how to access that element and set it to
something i would just set the text of the textbox to the state I
wanted

If i need to randomly set the text depending on my test i would just do
Set state as New York
job_application_page.set_state 'New York'
or use the default
job_application_page.set_state

in my page objects i would do something like this

class JobApplicationPage < BasePage
def set_state
state.send_keys(state_name)
end

def state
@driver.find_element(:id => 'state')
end

atleast in ruby i would but again i may not have understood the question

cassio kenji

unread,
Oct 24, 2011, 2:23:23 PM10/24/11
to seleniu...@googlegroups.com
Hi,

In here, I'm able to click at this with the following:

selenium.clickAt( "//*[@id='widget_state']/div[1]/input" , "" );

sor far, we can see the list of the states and inspecting we have it initiating just like :

//*[@id='state_popup0'] for 'Alabama' and //*[@id='state_popup1'] for 'Alaska'...

Hope it helps


2011/10/24 bis <bis...@gmail.com>

Pavan Kumar Chennam

unread,
Oct 24, 2011, 2:35:30 PM10/24/11
to seleniu...@googlegroups.com

Hello Cassio,

Thanks for reply, i have tried with your code but it is clicking only upto right side button and it is displaying all the value but we are unable to click the required element ( i.e State Name)

Please find the screen shot for this in Selenium IDE

Please help on this
Regards,
DojoComboBox.JPG

cassio kenji

unread,
Oct 24, 2011, 7:13:21 PM10/24/11
to seleniu...@googlegroups.com
Hi!

In my previous attempt, I was just clicking at the widget_state[1] to show up the options.
Like everything else, there are several ways to do the same. =)

I did a quick solution in here ( cause I don't have much time right now and I know you probably already tried some approaches ), but it seems like a workaround for me:

public void clickAtAlaska(){

        selenium.clickAt("//*[@id='widget_state']/div[1]/input", "");
        selenium.mouseOver("//*[@id='state_popup1']");
        selenium.mouseDown("//*[@id='state_popup1']");
        selenium.mouseUp("//*[@id='state_popup1']");
    }

I just move the mouse over the state I want and press down then release the mouse button.

I think this isn't the perfect solution, but I think now you'll not get stucked and it may helps you out while a elegant solution don't arises from yourself.

Hope it helps.



2011/10/24 Pavan Kumar Chennam <pavank....@gmail.com>

Pavan Kumar Chennam

unread,
Oct 25, 2011, 12:20:58 PM10/25/11
to seleniu...@googlegroups.com
Thanks Cassio,

Now i'm able to Select the value from the DojoCombo Box
 Really thanks for your Help ..:


Regards,
PavanChennam

swaathi gags

unread,
Oct 27, 2011, 7:34:17 AM10/27/11
to seleniu...@googlegroups.com
Hi,

if you already know the state name which you want to select,you can just type that State name in the text box.. using type command.

Thanks..
swaathi.

cassio kenji

unread,
Oct 27, 2011, 7:46:33 AM10/27/11
to seleniu...@googlegroups.com
Quite agree. It is a way too.

Althought, I'd mix up my scenarios with both situations... some with selection on the list and others typing the State I want.

Cheers,

2011/10/27 swaathi gags <mvsw...@gmail.com>
Reply all
Reply to author
Forward
0 new messages