- ccoxMaster
- Posts : 205
Join date : 2012-01-06
Age : 39
Location : Denver, CO
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:
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>
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.
Just try this and let me know that you are looking for same solution or not.
- ccoxMaster
- Posts : 205
Join date : 2012-01-06
Age : 39
Location : Denver, CO
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.
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.
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");
- ccoxMaster
- Posts : 205
Join date : 2012-01-06
Age : 39
Location : Denver, CO
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.
Permissions in this forum:
You cannot reply to topics in this forum