-1

i used this code to check splinter's clicking button option:

from splinter import Browser

    with Browser() as browser:
    # Visit URL
    url = "http://www.google.com"
    browser.visit(url)
    browser.fill('q', 'splinter - python acceptance testing for web applications')
    # Find and click the 'search' button
    button = browser.find_by_name('btnG')
    # Interact with elements
    button.click()
    if browser.is_text_present('splinter.readthedocs.org'):
        print("Yes, the official website was found!")
    else:
        print("No, it wasn't found... We need to improve our SEO techniques")

and i got exception: Element is not currently visible ans so may not be interacted. waiting for the browser is not the solution (becuase i made sleep method for long time and still doesnt work). this is sample code shown in https://splinter.readthedocs.org/en/latest/#sample-code , but is doesnt work for me

  • Possible duplicate of: [How do you click on an element which is hidden using Selenium WebDriver?](https://stackoverflow.com/questions/17448141/how-do-you-click-on-an-element-which-is-hidden-using-selenium-webdriver), and [Work with hidden select elemens in splinter (and selenium)](https://stackoverflow.com/questions/25322525/work-with-hidden-select-elemens-in-splinter-and-selenium) – machine yearning Sep 23 '15 at 07:06
  • 1
    Probably, using Selenium, you want to simulate the user experience. So, even if you could click on a "hidden" element (because it interacts with the DOM), but probably you want to wait until that element becomes visible. – ROMANIA_engineer Sep 23 '15 at 07:17
  • me explain of the question is re-etided, the answers is not working ... – Hen Porcilan Sep 23 '15 at 07:34

1 Answers1

0

If you want to wait for an element to become invisible, you can use wait function:

    wait = WebDriverWait(self.driver, 30)
    wait.until(EC.invisibility_of_element_located((By.XX, "something")))
BallpointBen
  • 9,406
  • 1
  • 32
  • 62
Mahsum Akbas
  • 1,523
  • 3
  • 21
  • 38