- imfausActive particpant
- Posts : 13
Join date : 2012-01-13
dynamically finding checkbox in multi-select drop down
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"]')]
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)
- ccoxMaster
- Posts : 205
Join date : 2012-01-06
Age : 39
Location : Denver, CO
Re: dynamically finding checkbox in multi-select drop down
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.
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.
- imfausActive particpant
- Posts : 13
Join date : 2012-01-13
Re: dynamically finding checkbox in multi-select drop down
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...
- zlos7arAmateur
- Posts : 41
Join date : 2012-01-13
Age : 36
Location : Germany
Re: dynamically finding checkbox in multi-select drop down
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 ?
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.
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 ?
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.
- How do I get checkbox element identifier generated dynamically?
- how to select checkbox whose id is not known or dynamic with selenium RC
- cant able to select drop down otions
- How to select multiple item from the web list and drop down list in Webdriver
- Can any one one help me to select drop down value using selenium webdriver
Permissions in this forum:
You cannot reply to topics in this forum