0

i am not able to click on the button i am getting error that element is not visible and i have tried by using xpath

driver.findElement(By.xpath("//button[@type='submit'][@name='btn_discuss']")).click();

but is not working

<button type="submit" name="btn_discuss"> View Details</button>
Ant's
  • 13,545
  • 27
  • 98
  • 148
Anant Jain
  • 9
  • 1
  • 3

1 Answers1

2

Your element is not visible. Thats the reason Selenium couldn't able to click on it.

Are you sure the element is visible? According to Selenium an element is visible if:

  • visibility != hidden

  • display != none (is also checked against every parent element)

  • opacity != 0 (this is not checked for clicking an element)

  • height and width are both > 0

  • for an input, the attribute type != hidden

See here for more info.

Community
  • 1
  • 1
Ant's
  • 13,545
  • 27
  • 98
  • 148