Using Python and Selenium, how do I find an extjs combobox with xpath? -
the html follows:
<input id="combobox-3829-inputel" class="x-form-field x-form-text" type="text" style="width: 100%; text-transform: uppercase; -moz-user-select: text;" name="combobox-3829-inputel" autocomplete="off" aria-invalid="false" data-errorqtip=""/>
i know need along these lines:
//input[starts-with(@id, "combobox-")]
but don't know after part. combo box can have text input in it, have part done. i'm trying convert absolute xpath shorter version. i've figured out buttons , finding text on fine, first run in combo box. i've searched many examples can find, haven't found recent 1 made clear me.
also, know xpath have defined above can find combo box, issue page has 2 combo boxes identical in every way except generated id number. how can index them?
thank in advance help.
if using static id's try //*[@id='combobox-3829-inputel']
// search elements [ * ]
id of combobox-3829-inputel [@id='combobox-3829-inputel']
edit: sounds these id's dynamic , generated on page load. looks know id begins "combo-box-", xpath should suffice
//input[starts-with(@id, "combobox-")]
for debugging , testing purposes may want tools in browser help
i believe chrome has default inspect > find element in "elements tab" > right click > copy > xpath
firebug provide support ff users
Comments
Post a Comment