Search
 
 

Display results as :
 


Rechercher Advanced Search

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Dynamic Drop Down Selection

View previous topic View next topic Go down

Dynamic Drop Down Selection

Post by ccox on 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>

ccox
Master
Master

Posts : 205
Join date : 2012-01-06
Age : 31
Location : Denver, CO

Back to top Go down

Re: Dynamic Drop Down Selection

Post by rohit13 on 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.

_________________
Radical QA
http://radical-qa.blogspot.in/

rohit13
Master
Master

Posts : 180
Join date : 2012-03-29
Age : 30
Location : INDIA

http://radical-qa.blogspot.in/

Back to top Go down

Re: Dynamic Drop Down Selection

Post by ccox on 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.


ccox
Master
Master

Posts : 205
Join date : 2012-01-06
Age : 31
Location : Denver, CO

Back to top Go down

Re: Dynamic Drop Down Selection

Post by rohit13 on 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");

_________________
Radical QA
http://radical-qa.blogspot.in/

rohit13
Master
Master

Posts : 180
Join date : 2012-03-29
Age : 30
Location : INDIA

http://radical-qa.blogspot.in/

Back to top Go down

Re: Dynamic Drop Down Selection

Post by ccox on 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.

ccox
Master
Master

Posts : 205
Join date : 2012-01-06
Age : 31
Location : Denver, CO

Back to top Go down

Re: Dynamic Drop Down Selection

Post by Sponsored content Today at 5:14 pm


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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