0

How to identify a Button in a Tool Bar in a web page?

Below is the location of the viewer and I need to identify "Open Document" and perform some operation on it?

https://demos.gnostice.com/html5/documentviewer.aspx

How do I identify an element when we don't have much information when we spy and inspect the element?

1
  • Hi Jp Reddy - when you inspect the element, can you show what is revealed? Also, it is not good practice to include a link to an external site as a crucial part of your question: if the site changes or is removed, the value of your question for future readers is lost. Commented Aug 18, 2016 at 9:33

2 Answers 2

3

css - "div[title*='Open document']" xpath - "//div[@title='Open document']"

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

Comments

0
IWebElement openDoc = driver.FindElement(By.XPath("//div[@title='Open document']"));

2 Comments

Hi siva; your code might be correct, but it would be better with some context; for example, you could explain how and why this proposed change would resolve the questioner's problem, perhaps including a link to the relevant documentation. That would make it more useful to them, and also more useful to other site readers who are looking for solutions to similar problems.
@VinceBowdren, Thanks for the suggestion, will keep in mind when i answer to questions.

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.