How to use Safari Technology Preview in nightwatch?

General Tech Technology & Software 2 years ago

0 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Technology & Software related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago


I didn't find any information on how to properly setup the nightwatch config using Safari technology preview.

I've tried something like this:

module.exports = {
    "src_folders": [
        "suites"
    ],
    "output_folder": "reports",
    "custom_commands_path": "commands",
    "page_objects_path": "pageObjects",
    "globals_path": "globals.js",
    "selenium": {
        "start_process": true,
        "server_path": seleniumServer.path,
        "host": "127.0.0.1",
        "port": 4444,
        "log_path": "logs",
        "cli_args": {
            "webdriver.chrome.driver": chromedriver.path,
            "webdriver.firefox.driver": '/usr/bin/geckodriver',
            "webdriver.safari.driver": '/usr/bin/safaridriver'
        }
    },
    "test_settings": {
        "default": {
            "launch_url": "http://google.com",
            "screenshots": {
                "enabled": true,
                "on_failure" : true,
                "on_error" : true
            },
            "globals": {
                "waitForConditionTimeout": 5000,
                "retryAssertionTimeout": 5000
            },
            "desiredCapabilities": {
                "browserName": "safari",
                "browserVersion": "12",
                "technologyPreview": true
            },
            "skip_testcases_on_fail": false,
            "end_session_on_fail": false
        }
    }
};

But after execution I get this error:

{ value: 
   { message: 'Could not create a session: A browser with name \'safari\' version \'12\' could not be found on the system.\nBuild info: version: \'3.13.0\', revision: \'2f0d292\', time: \'2018-06-25T15:32:19.891Z\'\nSystem info: host: \'Boostas-MacBook-Pro-5.local\', ip: \'fe80:0:0:0:100a:70f9:d6d7:cbfc%en0\', os.name: \'Mac OS X\', os.arch: \'x86_64\', os.version: \'10.13.6\', java.version: \'10.0.1\'\nDriver info: driver.version: unknown\nremote stacktrace: ',
     error: 'session not created' },
  status: 33 }

Note: If I set technologyPreview to false the test will be run in Safari browser.

Hope you guys can help me!

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.