-1

I have tried maximum possible ways but always getting :

org.openqa.selenium.ElementNotVisibleException: element not visible

exception for specific web element (with in popup window) during execution of selenium script.

Element Xpath value is: Element selector value is: #edited_name

Copied value of element is:

<input required="required" type="text" id="edited_name" name="edited_name" value="AT Main Category1" placeholder="" class="form-control">
Grasshopper
  • 8,908
  • 2
  • 17
  • 32
Ali
  • 11
  • 3

3 Answers3

0
  • Try adding a wait - Explicit wait or Implicit wait to wait for the element to become visible. May be add a 10 seconds wait.
  • Also, when using Xpath, don't use #, use by.cssSelector("input#edited_name");
demouser123
  • 4,108
  • 9
  • 50
  • 82
  • Dear demouser123- Thanks for your quick response. as i shared i tried maximum possible ways but in vain. I already tried the wait statements which you suggested also not worked. I also tried by.cssSelector("input#edited_name") (which you suggested) but this is also not working and i am still getting same error org.openqa.selenium.ElementNotVisibleException: element not visible – Ali May 07 '18 at 13:14
  • Is the element in a frame? – demouser123 May 07 '18 at 14:04
  • it's Modal popup window – Ali May 10 '18 at 07:56
0

As the desired element is a <input> element you can induce WebDriverWait as follows :

  • cssSelector :

    new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.cssSelector("//input.form-control#edited_name"))).click();
    
  • xpath :

    new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.xpath("//input[@class='form-control' and @id='edited_name']"))).click();
    
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • Dear DebanjanB, Thanks for your support but still getting below message Expected condition failed: waiting for element to be clickable: By.xpath: //input[@class='form-control' and @id='edited_name'] (tried for 20 second(s) with 500 MILLISECONDS interval) – Ali May 07 '18 at 15:17
  • @Ali Check the _Probable Reasons_ and _Solutions_ in the discussion [Element identified through find_element_by_xpath returns selenium.common.exceptions.ElementNotVisibleException: Message: element not visible](https://stackoverflow.com/questions/50182683/element-identified-through-find-element-by-xpath-returns-selenium-common-excepti/50183293#50183293) – undetected Selenium May 07 '18 at 15:22
  • Can you please take some time to know the difference between explicit wait and implicit wait? Explicit wait is set in local language binding but implicit wait is set in driver, so please don't suggest people to use explicit wait all the time. – Rajagopalan May 07 '18 at 18:29
  • Guys, can anyone propose any solution for my query? – Ali May 14 '18 at 07:06
0

If your unvisible element is in a pop-up window, you need to switch the driver to the pop-up window.

driver.switchTo().alert();
driver.findElement(...
pburgr
  • 1,722
  • 1
  • 11
  • 26
  • Dear pburgr, Now I am getting below after adding the statement which you suggested: org.openqa.selenium.NoAlertPresentException: no alert open – Ali May 10 '18 at 07:45