开发者

need help on xpath or css : clicking common popup.gif for all table data element such as "One" , "two"

开发者 https://www.devze.com 2023-01-29 03:03 出处:网络
<div id=\"idp\" class=\"att\"> <table class=\"attTab1\" csp=\"0\" cpad=\"0\"> <tbody>
<div id="idp" class="att">
    <table class="attTab1" csp="0" cpad="0">
        <tbody>
            开发者_如何学编程<tr>
                <td class="atName">One</td>
                <td class="atValuePopup">
                    <img class="pi" src="img/shared/popup.gif"/>
                </td>
            </tr>
            <tr>
                <td class="atName">Two</td>
                <td class="atValuePopup">
                    <img class="pi" src="img/shared/popup.gif"/>
                </td>
            </tr>
        </tbody>
    </table>
</div>

From comments:

I know table data element ahead of time (such as, "one", "two", three" in above snippet) and I want to click on popup.gif image drop down menu to verify the values in pop up list. So, we need xpath or css which can find popup.gif image based on table data element (such as "one", two", "three")


Use this absolute XPath expression:

/div/table/tbody/tr[td[@class='atName']='One']
                   /td/img[@src[substring(.,string-length()-9)='/popup.gif']]
0

精彩评论

暂无评论...
验证码 换一张
取 消