java - In Selenium WebDriver, how do I find an element with a DOM ID and no className? -
the element trying manipulate drop down autocomplete text box. rather normal text box this:
<input class="rad-input acinput float_left edschedulelist ui-autocomplete-input" style="width: 234px; font-size: 12px; font-family: segoe ui, arial, times new roman; padding-left: 4px; line-height: 12px;" placeholder="select schedule..." data-bind="click: _editoroverlay.overlay.customrecvm.scheduledata.ac.dropdownarrowclick, enable: _editoroverlay.overlay.customrecvm.scheduleenabled, jqauto: { autofocus: true }, jqautosource: editoroverlay.overlay.customrecvm.scheduledata.list, jqautoquery: editoroverlay.overlay.customrecvm.scheduledata.getlist, jqautovalue: _editoroverlay.overlay.customrecvm.scheduledata.selectedid, jqautosourcelabel: 'text', jqautosourceinputvalue: 'text', jqautosourcevalue: 'value', jqchange: _editoroverlay.overlay.customrecvm.scheduleindexchanged" id="domid08015369399681067" autocomplete="off">
i can't find id, cssselector, xpath, classname, name, or class. have tried partial or containing text , still getting no where. using java this.
i found out use cssselector class name. still relatively new selenium , did not know combine class names , cssselector methods. above element can manipulated following code:
driver.findelement(by.cssselector ("input[class='rad-input acinput float_left edschedulelist ui-autocomplete-input']"));
thanks guys, class name throwing me off. thought because selector coming dom had treat differently.
Comments
Post a Comment