Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

dynamically finding checkbox in multi-select drop down

View previous topic View next topic Go down

dynamically finding checkbox in multi-select drop down

Post by imfaus on Tue Feb 21, 2012 5:21 am

I am trying to click on a checkbox (that is a drop down in a multi-select). The problem is that the checkbox has no unique (valid) javascript ID.


Below is what I am trying in selenium and its failing. Any ideas? The product is using dotnetnuke which appears to have some unusual challenges with coding any type of gui automation. Thanks


Actual Element:

css=#dnn_ctr432_ViewMerchantWizard_MerchantWizard1_cbWizardPanel_ContactTab_ControlUC_ContactGrid_DXPEForm_efnew_EditContact1_ContactTypeCtrl_MultiSelectASPxDropDownEdit_DDD_DDTC_MultiSelectASPxListBox_LBI4T0 > input[type="checkbox"]


IDE command

xpath=//input[@type='checkbox'][contains(@id, 'ViewMerchantWizard_MerchantWizard1_cbWizardPanel_ContactTab_ControlUC_ContactGrid_DXPEForm_efnew_EditContact1_ContactTypeCtrl_MultiSelectASPxDropDownEdit_DDD_DDTC_MultiSelectASPxListBox_LBI4T0')]


HTML (IDE code)


mouseDown
xpath=//img[contains(@id, 'ViewMerchantWizard_MerchantWizard1_cbWizardPanel_ContactTab_ControlUC_ContactGrid_DXPEForm_efnew_EditContact1_ContactTypeCtrl_MultiSelectASPxDropDownEdit_B-1Img')]



click
xpath=//input[contains(@id, 'ViewMerchantWizard_MerchantWizard1_cbWizardPanel_ContactTab_ControlUC_ContactGrid_DXPEForm_efnew_EditContact1_ContactTypeCtrl_MultiSelectASPxDropDownEdit_DDD_DDTC_MultiSelectASPxListBox_LBI4T0 > input[type="checkbox"]')]



imfaus
Active particpant
Active particpant

Posts : 13
Join date : 2012-01-13

Back to top Go down

Re: dynamically finding checkbox in multi-select drop down

Post by ccox on Tue Feb 21, 2012 11:21 am

Is it failing because it is unable to locate the check box, or is it failing because it is unable to locate the drop down after the check box is selected?

Have you tried using clickAndWait instead of click? Sometimes adding that "AndWait" can help recognize the dropdown. I have also used the "waitForChecked" command to make sure the check box is selected before continuing.


ccox
Master
Master

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

Back to top Go down

Re: dynamically finding checkbox in multi-select drop down

Post by imfaus on Tue Feb 21, 2012 9:42 pm

the workflow is that I initially select the drop down, so I can find this piece the checkbox is embedded in the element...

imfaus
Active particpant
Active particpant

Posts : 13
Join date : 2012-01-13

Back to top Go down

Re: dynamically finding checkbox in multi-select drop down

Post by zlos7ar on Tue Feb 21, 2012 9:46 pm

There are several ways to find an element did you try them all ?
1. finding element by ID
2. finding element by name
3. finding element by link text
4. finding elements by accessing the DOM through JavaScript
5. finding element by XPath
6. finding element by css
7. finding elements by their attribute

Did I miss anything ? Smile
I am pretty sure you can probably use something like this xpath=//div[@class='classname'] ---> that will work if the element have unique class and usually when everything else is the same the class is different. Developers also need to have something unique in their elements so I am sure that not everything is the same you just have to find the difference and use on of the above methods to select the element.

zlos7ar
Amateur
Amateur

Posts : 41
Join date : 2012-01-13
Age : 28
Location : Germany

Back to top Go down

Re: dynamically finding checkbox in multi-select drop down

Post by Sponsored content Today at 8:53 am


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