Element is not currently visible and may not be manipulated exception
Simple code in selenium works in both Firefox driver and HtmlUnit driver but it fails with PhantomJs as it returns element not visible exception.
Steps.
- Go to page https://signup.live.com/
- Select element by id iBirthDay
- Set value by value
I get the same problem. I have a form with just two input fields. Works perfectly OK in Firefox and other browsers, but when using PhantomJS, I get an
"InvalidElementStateException: Message: u'Error Message => 'Element is not currently interactable and may not be manipulated"
I can clearly see the the input elements are present when I take a screenshot via selenium functions.
Is this an issue with PhantomJS itself?
Have the same problem. Using Coypu. When running in Firefox everything works fine, but in PhantomJS I get a ElementNotVisibleException when I try to sumulate a link click.
From screenshots I can see that the link is visible.
Same problem with pahntomjs version 1.9.2. To reproduce - navigate to the same page twice, then try to click visible element webdriver.get(url) webdriver.get(url) webdriver.find('#my_elem').click()
raises ElementNotVisibleException: 'Element is not currently visible and may not be manipulated'
I'm also encountering this issue (works fine in Firefox, chokes in PhantomJS) using WebDriver with Python
Here's the snippet in question:
driver.execute_script("window.scrollTo("+ str(selected_sites_textbox_location['x']) + ","+ str(selected_sites_textbox_location['y']) +");")
for site_name in site_names:
for num_placements in range(scraper.conf['sites'][site_name]):
# Code chokes here.
selected_sites_textbox.send_keys(site_name)
sleep(2)
selected_sites_textbox.send_keys(Keys.RETURN)
Same for me, works on Firefox but not working with PhantomJS. "phantomjs ElementNotVisibleException: Message: u'Error Message => 'Element is not currently visible and may not be manipulated"
Hi guys, I just found a solution. Try this browser = webdriver.PhantomJS() browser.set_window_size(1124, 850) # set browser size. browser.get("http:example.com") # Load page
The solution is we need to set a fake browser size before doing browser.get("").
Hope this helps
I was setting window, so it will not solve my issue. I am taking screenshot and I can see element there but it still will give this error when I try to change value of that element.
I set the window to maximize and the problem persisted. Looking at the screenshot though it was only 400px wide. The element was visible, but on a hunch I set the screen dimensions to exactly 1024px wide and the test passed.
I also have this problem and i have an idea why it's happening. It seems like when there is a div, (which is always visible and does not scroll) (Like on the live.com website), The displayed property for this div is true, but for all other elements on that page, it is false.
I also have this problem, resizing the window does fix it.
Thanks to @shankig
Resizing or changing window size is not fixing it. In your case it is not a issue but you just did not set window size correctly. Issue is when you have window set up and on screen shot you can see element but browser reports it as invisible.
Resizing the window seems to have remedied the issue for me, but this isn't really a fix, considering the original script ran fine without a hitch in Firefox without having to resize the window.
Like i said, this problem occurs on certain websites when there is a div, which is fixed and always visible. check https://signup.live.com/
Hi guys, I have tried a lot with different ways to solve the issue. But resizing the window was the last option available to me.
I am experiencing this issue with clearly visible radio buttons. Tests run fine in Firefox but fail in phantonjs, the page resize work around does not resolve the issue for me.
Was just running into this issue myself process was clearing text input value then entering new value changed driver.clear() to driver.clear w/o parens and works fine
using protractor.js, setting window size fixed this error. thanks @shankig
driver.manage().window().setSize(1000, 800);
Calling: element.clear before using element.set_keys works for me! Thanks micurley.
Thanks @shankig browser.set_window_size(1440, 900) # Fixes "Element is not currently interactable and may not be manipulated" in PhantomJS 1.9.7
Thanks @shankig browser.set_window_size(1120, 550) works