-3

I am testing a link using webdriver, but i am not able to locate where that link(element) is there on the webpage. How to detect that where the given element is present on the webpage? Can anybody help?

Sneha
  • 7
  • 1
  • 6

3 Answers3

1

From the Getting Started Documentation, you can use:

WebElement element = driver.findElement(By.name("elementName"));

Where elementName is the name of the element that you are looking for.

SeniorJD
  • 6,240
  • 4
  • 32
  • 50
Gnarlywhale
  • 3,388
  • 2
  • 13
  • 17
0

Use Ctrl+Shift+I in chrome browser, and try to find that element in the developer's console using Ctrl+F. (You will have to click developer console's screen first before you do Ctrl+F)

zookastos
  • 795
  • 7
  • 31
0

U can check the presence of element by using explicit wait

wait.until(ExpectedConditions.visibilityOf(element))

it will return true or false, boolean value can be used.

viki
  • 11
  • 7