XPATH FOR DYNAMIC DROP DOWN

0 votes

Hi all,

I am facing some challenges in identifying the XPath for the dropdowns mentioned in the  below image::

Can some help in this regard? 

Below is the HTML code

<div class="x-field x-form-item x-form-item-default x-form-type-text x-box-item x-toolbar-item x-field-default x-hbox-form-item x-form-item-no-label" style="width: 300px; left: 54px; top: 6px; margin: 0px;" role="presentation" id="combo-1101">
<label id="combo-1101-labelEl" data-ref="labelEl" class="x-form-item-label x-form-item-label-default x-unselectable" style="padding-right:5px;width:105px;" for="combo-1101-inputEl">
<span class="x-form-item-label-inner x-form-item-label-inner-default" style="width:100px">
<span id="combo-1101-labelTextEl" data-ref="labelTextEl" class="x-form-item-label-text">
</span>
</span>
</label>
<div id="combo-1101-bodyEl" data-ref="bodyEl" role="presentation" class="x-form-item-body x-form-item-body-default x-form-text-field-body x-form-text-field-body-default ">
<div id="combo-1101-triggerWrap" data-ref="triggerWrap" role="presentation" class="x-form-trigger-wrap x-form-trigger-wrap-default">
<div id="combo-1101-inputWrap" data-ref="inputWrap" role="presentation" class="x-form-text-wrap x-form-text-wrap-default">
<input id="combo-1101-inputEl" data-ref="inputEl" type="text" size="1" name="combo-1101-inputEl" aria-hidden="false" aria-disabled="false" role="combobox" aria-haspopup="true" aria-expanded="false" aria-owns="combo-1101-inputEl combo-1101-picker-listEl" aria-autocomplete="list" aria-invalid="false" aria-readonly="false" aria-describedby="combo-1101-ariaStatusEl" aria-required="false" class="x-form-field x-form-text x-form-text-default " autocomplete="off" data-componentid="combo-1101">
</div>
<div id="combo-1101-trigger-picker" class="x-form-trigger x-form-trigger-default x-form-arrow-trigger x-form-arrow-trigger-default " role="presentation">
</div>
</div>
<span id="combo-1101-ariaStatusEl" data-ref="ariaStatusEl" aria-hidden="true" class="x-hidden-offsets"</span>
<span id="combo-1101-ariaErrorEl" data-ref="ariaErrorEl" aria-hidden="true" aria-live="assertive" class="x-hidden-clip">
</span>
</div>
</div>

Jul 12, 2020 in Selenium by MOHAMMED
• 120 points
2,578 views
Hey @Mohammed, what exactly are you trying to do?

I'm facing a similar issue. Can anyone help to create XPath for the attached HTML code ??

<div class="Dropdown-root false is-open"><div class="Dropdown-control postedby_selector" aria-haspopup="listbox"><div class="Dropdown-placeholder">Select</div><div class="Dropdown-arrow-wrapper"><span class="Dropdown-arrow"></span></div></div><div class="Dropdown-menu postedby_options" aria-expanded="true"><div class="Dropdown-option" role="option" aria-selected="false">Self</div><div class="Dropdown-option" role="option" aria-selected="false">Son</div><div class="Dropdown-option" role="option" aria-selected="false">Daughter</div><div class="Dropdown-option" role="option" aria-selected="false">Brother</div><div class="Dropdown-option" role="option" aria-selected="false">Sister</div><div class="Dropdown-option" role="option" aria-selected="false">Friend</div><div class="Dropdown-option" role="option" aria-selected="false">Relative</div></div></div>
Hey @Vrushali, what's the error that you are getting?

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Selenium

0 votes
0 answers

Initialize WebElement for dynamic XPath

XPATH's are defined by the end user. I just ...READ MORE

Aug 20, 2019 in Selenium by anonymous
3,299 views
0 votes
0 answers

The xpath of the element keeps changing, how do i find dynamic xpath for this

Can you please help on this, I ...READ MORE

Nov 21, 2020 in Selenium by Rakshith
• 120 points

recategorized Nov 23, 2020 by Niroj 1,688 views
0 votes
1 answer

XPath for the elements with no ID or Name in Selenium Webdriver

Use like this or similar to this: //div[@id="top-level-menu-item-3"]/div[@class="filter-label"] //div[@id="top-level-menu1"] ...READ MORE

answered Apr 17, 2018 in Selenium by Meci Matt
• 9,460 points
7,458 views
0 votes
1 answer

Need to scroll down for locating an Element with Selenium

There are a couple of options for ...READ MORE

answered Apr 21, 2018 in Selenium by king_kenny
• 3,710 points
12,970 views
0 votes
1 answer

How to choose from a drop-down in Selenium 2?

You can probably use the 'Select' class ...READ MORE

answered Apr 24, 2018 in Selenium by king_kenny
• 3,710 points
1,183 views
0 votes
1 answer
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
13,765 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,184 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
7,258 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,896 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP