1

How will you locate the element using its “Click Payment History” text using XPATH & CSS?

<html> 
    <head> 
        <title>My Account</title>
    </head>

    <body> 
        <table> 
            <tr><td>John</td></tr>
            <tr><td>Shield</td></tr> 
        </table> 

        <div>Click Payment History</div> 
    </body> 
</html> 
2
  • 1
    At the server or at the client? What language? Your question is lacking details and you may find it closed. Commented Nov 11, 2012 at 20:04
  • The code is : <html> <head> <title>My Account</title> </head> <body> <table> <tr><td>John</td></tr> <tr><td>Shield</td></tr> </table> <div>Click Payment History</div> </body> </html> Commented Nov 11, 2012 at 20:09

2 Answers 2

1

In CSS:

div

In xpath:

//div

Not maintainable but they'll work for your example.

Sign up to request clarification or add additional context in comments.

Comments

0

A way to find xpath is Firepath an extension of Firebug.

1 Comment

not exactly. Firepath allows you to enter found xpath, css selector and locate appropriate web element on web page. But finding can be performed in HTML tab of firebug as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.