Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» how to connect DB in selenium webriver
Fri Oct 06, 2017 4:09 pm by anbarasi

» How find any text in browser screen and click on it?
Thu Oct 05, 2017 2:02 pm by sandeepkommineni

» Selenium Webdriver
Tue Oct 03, 2017 1:35 pm by PiyushBiswas

» GRID setup tutorial.
Wed Sep 27, 2017 4:29 pm by johnyapp

» Drag & Drop Between Windows Using Selenium Driver
Wed Sep 27, 2017 2:10 pm by 26rondel

» Check if window is closed / verify input
Sat Sep 23, 2017 10:21 pm by brainstir

» How to work on pages with AJAX in selenium?
Mon Sep 18, 2017 6:08 pm by azharuddin

» pause test until user press a key like F2
Wed Aug 09, 2017 11:10 pm by djnforce

» Selecting the input for auto populating element
Sat Jul 29, 2017 7:53 pm by kdabbara

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 : 32
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 : 29
Location : Germany

Back to top Go down

Re: dynamically finding checkbox in multi-select drop down

Post by Sponsored content


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