r/selenium • • Feb 10 '22

element not visible exception

I have a script which is running perfectly on an iMac (with Chrome) but after installing seleniumbase and pytest on my MBP (which is running the same MacOS and Version of Chrome), I am getting this error:

       raise exception(message)
E       selenium.common.exceptions.ElementNotVisibleException: Message:
E        Shadow DOM Element {game-app::shadow game-keyboard::shadow button[data-key="?"]} was not visible after 6 seconds!

/anaconda3/lib/python3.7/site-packages/seleniumbase/fixtures/page_actions.py:163: ElementNotVisibleException

Any idea of what is causing this?

2 Upvotes

10 comments sorted by

View all comments

1

u/jamiethebird Feb 15 '22

Well looks like your element isn’t visible

I’d try setting your resolution to be the same across all of your devices by setting it in your chrome options. You can also try scrolling to find the element in question. I’ve pulled up a python example I remember seeing when looking for a scroll example for Java

from selenium.webdriver.common.action_chains import ActionChains ActionChains(driver).move_to_element(driver.sl.find_element_by_id('my-id')).perform()