ich die //input[@id=(//label[text()='Search for:']/@for)]
zu CSS-Selektor in SelenIch möchte CSS gegeben Xpath in konvertieren
Nach konvertieren möchten ist die HTML-
<td class="mstrSearchFieldSearchBox">
<div title="" class="mstrTextBoxWithIcon" id="id_mstr56" style="display: block;">
<div class="mstrTextBoxWithIconCaption">
<label for="id_mstr56_txt">Search for:</label>
</div>
<table cellspacing="0" cellpadding="0" class="mstrTextBoxWithIconTable">
<tbody>
<tr>
<td class="mstrTextBoxWithIconCellInput">
<div>
<input maxlength="" onclick="if (mstr.utils.ISW3C) {this.focus();}" onkeypress="return mstr.behaviors.TextBoxWithIcon.onkeypress(arguments[0], self, 'id_mstr56', this.value)" name="id_mstr56_txt" style="background-color: rgb(255, 255, 255);" id="id_mstr56_txt" size="" type="text">
</div>
</td>
<td class="mstrTextBoxWithIconCellIcon">
<div class="mstrToolButtonRoundedRight" style="background-position: left center;">
<input type="button" title="Search" onmouseout="mstr.behaviors.ToolButtonRounded.unhover(this.parentNode)" style="background-position: left center; cursor: pointer;" class="mstrBGIcon_tbSearch" src="../images/1ptrans.gif" onmouseover="mstr.behaviors.ToolButtonRounded.hover(this.parentNode)" onclick="mstr.behaviors.TextBoxWithIcon.fire('id_mstr56', this.parentNode.parentNode.previousSibling.childNodes[0].childNodes[0].value);return false;">
</div>
</td>
</tr>
</tbody>
</table>
</div>
</td>
@Dev: Ich benutze Google Chrome-Konsole, um Element zu identifizieren und es im automatisierten Test für Selen weiter zu verwenden. Ich bekomme Element als ** $ x ("// input [@id = (// label [text() = 'Suche nach:']/@ for)]") [0] .getAttribute ("id") "id_mstr56_txt" ** Jetzt möchte ich css von diesem Pfad machen –
Wie können Sie das bekommen? '$ x (" // input [@id = (// label [text() = 'Suchen nach:']/@ for)] ") [0] .getAttribute (" id ")" id_mstr56_txt "' Danke – DebanjanB
@Dev: Ich versuchte von der Chromkonsole, um Element zu identifizieren, in dem ich Verbindung des Eingabetyps und sein label hielt, hier label der Steuerung ist ** Suchen nach: ** –