Exiting the Protractor timeout setting for Safari WebDriver

While I have experience with unit tests using Karma, my office is now interested in integration tests, specifically to test cross-browser capabilities. Protractor seemed like the best option for this, so I began working on some basic dashboard tests. However, I have run into a roadblock with Safari.

My Configuration:

exports.config = {
    seleniumAddress: 'http://localhost:4444/wd/hub',

    specs: ['scenarios/*Scenario.js'],

    framework: 'jasmine',

    baseUrl: 'https://www-dev.remeeting.com/',

    multiCapabilities: [{
        browserName: 'firefox'
    }, {
       browserName: 'chrome'
    }, {
       browserName: 'safari'
    }],

    onPrepare: function() {
        browser.driver.get('https://www-dev.remeeting.com/');

        browser.driver.findElement(by.id('email')).sendKeys('<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="432227222e6837263037032e2c277a6d6c6d202c2e">[email protected]</a>');
        browser.driver.findElement(by.id('password')).sendKeys('abc123');
        browser.driver.findElement(by.id('submit_btn')).click();

        // Login takes some time, so wait until it's done.
        // For the test app's login, we know it's done when it redirects to
        // app/#/d.
        return browser.driver.wait(function() {
            return browser.driver.getCurrentUrl().then(function(url) {
                return /app\/#\/d/.test(url);
            });
        }, 10000);
    }
};

My Only Spec:

describe('Dashboard', function() {
    it('should login to the dashboard', function() {
        expect(element(by.css('.dashboard')).getText()).toMatch(/Upload Meeting/);
        expect(element(by.id('refreshButton')));
        expect(element(by.css('.dashboard div.btn-group')));
    });
});

The Error:

[safari #21] PID: 79079
[safari #21] Specs: /Users/adam/git/mrp-  www/e2e/scenarios/dashboardScenario.js
[safari #21]
[safari #21] Using the selenium server at http://localhost:4444/wd/hub
[safari #21] ERROR - Unable to start a WebDriver session.
[safari #21] Unknown command: setTimeout (WARNING: The server did not provide any stacktrace information)
...
[safari #21] Driver info: org.openqa.selenium.safari.SafariDriver
[safari #21] Capabilities [{browserName=safari, takesScreenshot=true, javascriptEnabled=true, version=9.1, cssSelectorsEnabled=true, platform=MAC, secureSsl=true}]
[safari #21] Session ID: null

[launcher] Runner process exited unexpectedly with error code: 1
[launcher] 2 instance(s) of WebDriver still running

Does anyone have insights on how to configure Protractor for Safari?

Answer №1

If you're looking to set up Safari + Protractor successfully, follow these steps:

  • Verify you have the latest version of Safari (currently at 9.1)
  • Download the newest Safari driver from this site. Then, go to Safari extensions preferences, and drag and drop the SafariDriver.safariextz file into the extension list.

https://i.sstatic.net/W5X3H.png

  • Upgrade protractor to the most recent version (currently 3.2.2).

If needed, you can also use BrowserStack or SauceLabs to run Safari remotely.


For more information, check the list of Safari+Protractor issues.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What are the best practices for utilizing databases with both Javascript and JSF frameworks?

I am currently following the recommendations provided by @BalusC, with additional guidance available here. (The reason I'm posting this here is because it's not related to my previous question). My goal is to retrieve data from my database and d ...

The Reason Behind Component Non-ReRendering in Redux

I am currently facing an issue with my component and reducer. The `componentDidMount()` method in my component is calling a server to get some data, but the component doesn't re-render after the action is performed. I have checked my code multiple tim ...

Determine the optimal number of units to purchase with a given budget

Looking to automate a procurement process with my new agent: let perunitcost = 100; let agentMaxQty = 60 let agentMaxTotal = 5000 let qtyToBePurchased = 0 The agent has a budget limit of $5000 and can procure up to 60 items. In this scenario, the agent w ...

JQuery unable to recognize dynamically inserted Anchor Tag through AJAX request

I am currently working on a page that is sourcing a large amount of data from a database through various PHP files. To achieve this, I am using JQuery to identify specific events and trigger AJAX requests to the necessary PHP file to display the required c ...

Encountering a connection error when trying to access a Google spreadsheet within a Next.js application

I am currently exploring Next.js and attempting to utilize Google Sheets as a database for my project. Although my application is functioning correctly, there is still an error message displaying that says "not forgot to setup environment variable". I have ...

I must choose two random arguments with a specific percentage in mind

I am trying to create a random selection process for two options with assigned percentages. For instance, variable 'a' (like) has an 82.5% chance of being selected, while variable 'b' (dislike) has a 17.5% probability. If neither &apos ...

Deactivate the submission button when there are no search results in typeahead.js

How can I disable the submit button if there are no search results found? The form should not be submitted in this scenario. I am currently using typeahead.js for my code. $('.typeahead').typeahead(null, { name: 'suburb', disp ...

"Utilizing Promises in AngularJS Factories for Synchronous API Calls

Attempting to implement synchronous calls using a factory pattern. $scope.doLogin = function (username, password, rememberme) { appKeyService.makeCall().then(function (data) { // data = JSON.stringify(data); debugAlert("logi ...

What is the best way to increase incremental values that are nested within each other

A database has been loosely created with a key known as website. Inside this website object, multiple objects exist, one for each dynamically generated website. An illustration of how the database might appear is shown below: website: { google.com: { ...

Having trouble creating a table using a JSON object in AngularJS

Click here to view the converted JSON object Please pay close attention to my question Hello, in the code below I am attempting to convert XML data into a JSON object. With this converted JSON object, I am aiming to create a table using AngularJS. The is ...

How can you generate a Ref in React without utilizing the constructor by using React.createRef?

In the past, I relied on using constructor in React for just three specific purposes: 1. Initializing state as shown below: class App extends React.Component { constructor(props) { super(props); this.state = { counter: 0 }; } } H ...

Providing real-time results as numbers are added together

I need assistance in calculating a price inclusive of VAT based on a user-entered VAT rate. Is it possible to show the result in an input box dynamically as the user inputs the VAT rate and price, without requiring them to click a button or resubmit the fo ...

Explanation of JavaScript code snippet

fnTest = /abc/.test(function () { abc; }) ? /\bchild\b/ : /.*/; I am struggling to comprehend the functionality of this particular javascript snippet. Would someone be able to elaborate on the logic behind this code fragment? ...

Error encountered during sequelize synchronization: SQL syntax issue detected near the specified number

Four Sequelize Models were created using sequelize.define();. Each model is similar but with different table names. To avoid manual creation of tables in MySQL cli, the decision was made to use sequelize.sync() in the main index.js file to allow Sequelize ...

What is the best way to create an index for a user-provided value in a textbox

Looking for guidance on how to set an index to user-provided values in a textbox, append them to a table in a new row, and display that index in the first column of every row. I am unfamiliar with this type of functionality. $(document).ready(function() ...

once a value is assigned to the variable "NaN," it remains constant and does not alter

What is the reason for not getting an assigned value in the line val3.value = parseInt(val1.value + val2.value);? Is it because the specified value "NaN" cannot be parsed, or is it out of range? var val1 = parseInt(document.getElementById("num1")); var ...

Executing the test case using the IE browser in Selenium with C#

Currently, I am delving into selenium webdriver using C#. Upon running the test case for testing the IE browser, I encountered the following error: The test method AgileTravelUITests.GoogleSearchTest.TestIE threw an exception: OpenQA.Selenium.DriverServ ...

What is the best way to prevent two paths within an SVG from intersecting with each other?

Currently, I am developing a program that allows the user to draw lines. Once the user completes drawing a line, I receive an array of points in this format: [[x, y], [x, y], ...]. I then convert these points into a path string using the following functio ...

Initiate a JavaScript confirmation dialog using server-side logic in ASP.NET

Does anyone know how to troubleshoot the issue with this code? I am trying to make it so that when btnOne is clicked and a is true, a confirm box pops up. If yes is selected, then it should execute the btnTwo method. Currently, the popup isn't appeari ...

Using jQuery to locate and delete multiple attributes from div elements

My goal is to locate all div elements with the class name "comment-like" that also have data-id attributes set to 118603,1234,1234,118601,118597. If a div contains any of these data values, then I want to remove that data attribute. I've attempted th ...