python-3.xseleniumautomationsafarisafaridriver

Disable automation warning in Safari when using selenium


I Would like to perform tests in safari, using selenium.

Unfortunately, when I try to debug issues using the safari, a notification appears which requires me either disable automation in safari or to quit (attached image).

why I cannot do it as in Chrome & FireFox (for ex: press F12 to see the DOM) ? error screenshot

Note: I'm using MacOs Catalina with Javascript & Python for selenium


Solution

  • So, to summarize for all other (frustrated) developers who come across #Safari and try to automate it.. it is impossible to write automation because of this limitation.

    So the options are:

    1. Write in other browser (such as chrome) and verify it works in safari
    2. Manually in other session in safari(manual) locate your locators/paths and then insert to you automation-infra

    and to add to complexity - Selenium clicks doesnt work in many places where on chrome/ff/edge DO work. so, possible solution to that - is to use JS in DOM - but that is also not perfect.

    hopefully the situation will improve