Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
ccox
Master
Master
Posts : 205
Join date : 2012-01-06
Age : 38
Location : Denver, CO

Dynamic Drop Down Selection Empty Dynamic Drop Down Selection

Wed May 16, 2012 10:41 pm
I am trying to automate an application that has a drop down that dynamically populates with customer names. The drop down does not actually populate with data until it is selected. When running through the script it thinks it selects something and passes the step, but nothing actually happens. I have tried selecting the index, label, value, storing the name and selecting it, clickAt, mouseDown, keyPress, focus, etc. and nothing seems to work. Any suggestions?

Here's the code:
Code:

<select> index="0" onchange="nc.validate.onChange(this);nc.bizrules.showField(this);" onblur="nc.validate.validateField(this);" onfocus="nc.bizrules.appraisalContactNameOnFocus(this)" validatesect="appraisal" oldvalue="" ctrltype="cbo" isdirty="N" id="cboAIContactName0" name="ctl00$cphMain$ucAppraisal0$cboAIContactName0"
       

</select>
<option value="">--‌·Select‌·--</option>
<option value="-1001">Customer Name</option>
<option value="-1002">Customer Name2</option>
<option value="-1002">Customer Name3</option>
<option value="OTHER">Other</option>
</select>
rohit13
rohit13
Master
Master
Posts : 180
Join date : 2012-03-29
Age : 37
Location : INDIA
http://radical-qa.blogspot.in/

Dynamic Drop Down Selection Empty Re: Dynamic Drop Down Selection

Thu May 17, 2012 11:19 am
As drop-down data is uploading after selecting drop-down, you just click on drop-down to expand then put wait then select particular option from drop-down.

Just try this and let me know that you are looking for same solution or not.
avatar
ccox
Master
Master
Posts : 205
Join date : 2012-01-06
Age : 38
Location : Denver, CO

Dynamic Drop Down Selection Empty Re: Dynamic Drop Down Selection

Thu May 17, 2012 10:58 pm
I have tried that multiple times with the same results.

selenium.click("id=cboAIContactName0");
selenium.select("id=cboAIContactName0", "label=Other");

Both of these steps pass, but nothing is actually selected. "Other" is always an option in the drop down, but doesn't populate until the names do.

What's weird is I can store what is in the drop down and see all of the options, but Selenium can't seem to select any.

String[] names = selenium.getSelectOptions("id=cboAIContactName0");
System.out.println(names);
//This returns all of the names prior to taking an action on the drop down.

rohit13
rohit13
Master
Master
Posts : 180
Join date : 2012-03-29
Age : 37
Location : INDIA
http://radical-qa.blogspot.in/

Dynamic Drop Down Selection Empty Re: Dynamic Drop Down Selection

Fri May 18, 2012 11:42 am
I am talking about below code -

Code:
selenium.click("id=cboAIContactName0");
Thread.sleep(5000);
selenium.select("id=cboAIContactName0", "label=Other");
avatar
ccox
Master
Master
Posts : 205
Join date : 2012-01-06
Age : 38
Location : Denver, CO

Dynamic Drop Down Selection Empty Re: Dynamic Drop Down Selection

Fri May 18, 2012 11:54 am
I tried using pause | 5000, 10000, etc. and just pauses and moves on. When I use clickAndWait, it times out.
Sponsored content

Dynamic Drop Down Selection Empty Re: Dynamic Drop Down Selection

Back to top
Permissions in this forum:
You cannot reply to topics in this forum