Protractor encounters difficulties in Firefox and Internet Explorer browsers

Having trouble running tests with the protractor in Firefox

Here's a test case that works fine in Chrome, but fails in Firefox and IE browsers.

Sample Test File

<html>
    <head>
        <title>automation test</title>
        <style>
            #tst{
                width: 200px;
                height: 200px;
                border: 1px solid;
            }
        </style>        
    </head>
    <body>        
        <div id="tst"></div>
        <button id="clickme">Click me</button>        
        <script>

            document.getElementById('clickme').addEventListener('click', function(e){
                document.getElementById('tst').style.backgroundColor = 'red';
            });

        </script>
    </body>
</html>

Specs File (indexspecs.js)

describe('sample test', function(){

    it('change background color to red when button is clicked', function(){
        browser.driver.get("http://localhost/test/index.html");
        var btn = browser.driver.findElement(by.id('clickme'));
        var clRed = "rgba(255, 0, 0, 1)";
        btn.click();

        expect(browser.driver.findElement(by.id('tst')).getCssValue('background-color')).toEqual(clRed);
    });
});

Protractor Configuration File

exports.config = {

    seleniumAddress: 'http://localhost:4444/wd/hub',

    specs: ['indexspecs.js'],

    jasmineNodeOpts: {
        showColors: true
    },

    capabilities: {
//        'browserName': 'internet explorer'
        'browserName': 'firefox'
    }
};

Protractor Version - 2.0.0
Firefox Version - 45
IE Version - 11

While using Firefox as the browser option, the browser opens but doesn't navigate to the URL to run the test.

Answer №1

Your question is too vague to determine the exact cause of the issue. However, I will address some common issues that could be contributing to your problem

  1. Upgrade to the latest version of Protractor (use npm update protractor) - you are currently using 2.0.0 which is outdated (protractor --version to verify after updating). I am using version 3.3.0. There is even a newer version available - Protractor I tested your script and it works perfectly with Firefox 45

  2. Regarding Internet Explorer, make sure you have the IE driver installed. If not, run the following command

    webdriver-manager update --ie
    

Your script may encounter issues in IE due to warning messages about 'Active X methods being blocked'. You might need to adjust the ignore settings in IE before running the script

Answer №2

If you're interested in running a standalone Selenium Server on your local machine, you can follow these steps:

Firstly, take a look at the configuration file provided here

Your configuration file should resemble something like this:

exports.config = {

    seleniumServerJar: 'node_modules/protractor/selenium/selenium-server...',

    specs: ['indexspecs.js'],

    jasmineNodeOpts: {
        showColors: true
        defaultTimeoutInterval:30000
    },

    capabilities: {
        //'browserName': 'internet explorer'
        'browserName': 'firefox'
    }
};

You can download the required jar file from here

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

Determine the return type of a function based on a key parameter in an interface

Here is an example of a specific interface: interface Elements { divContainer: HTMLDivElement; inputUpload: HTMLInputElement; } My goal is to create a function that can retrieve elements based on their names: getElement(name: keyof Elements): Elemen ...

Unlock the potential of displaying similar object values side by side in JavaScript, React, and ES6 - here's how!

Currently, I am dealing with an object called segregatedData which is being passed as props. Among its several properties, we are interested in segregatedData.type1. This particular property is essentially an array of strings similar to this: ['water& ...

Using Sinon with Ember to create a Mock Server

I am looking to test my controller by making an ajax call to my backend using Jasmine and Sinon. To fake my backend server with Sinon, I attempted the following approach: describe("fake server", function() { var server; beforeEach(function() { this ...

Struggling to incorporate jquery and jquery-ujs into Browserify, encountering an error stating Uncaught ReferenceError: jQuery is not defined

I am currently working on a Ruby on Rails project and utilizing Browserify to manage my JavaScript dependencies. However, I keep encountering an error message stating "Uncaught ReferenceError: jQuery is not defined" because jquery-ujs is attempting to call ...

Navigating to a different page on Vue2 with routes

I am struggling with redirecting to another Vue page from my script code. I tried using router.push() but it's not directing me to the desired Vue page. Here is a snippet of my source code: src/router/index.js import Vue from 'vue' import ...

Disordered city names discovered while conducting reverse geocoding with a maps API in a loop

I am currently working on reverse geo-coding a series of coordinates using a for loop in node.js. After each iteration, I store the result in an array. However, when I try to display the array in my angular front-end or check it in the console, the order o ...

Issues with the History API in AJAX Requests

Recently, I have come across a dynamically generated PHP code: <script> parent.document.title = 'Members | UrbanRanks'; $("#cwrocket_button").click(function(){ $("#module").load("modu ...

What is the best way to retrieve information from a webpage I have created using an express backend and an HTML frontend

I designed a login page named index.html that prompts users to enter their email and password, followed by a submit button with the label "Log In": <input type="submit" value="Log In" id="loginbutton"> Within my app.js ...

warning: issue detected with the password value in jquery

Why is the following script generating an incorrect JavaScript alert message? <script type="text/javascript> $('#cpassword').change(function() { var pass=$('#password').val(); alert(pass); var cpass=$(& ...

Timeout during the beforeLoad event

I am currently working on writing some ExtJS 4 script and have come across the following code: var companyStoreModel = Ext.create('Ext.data.Store', { model: 'CompanyDataModel', proxy: { type: 'ajax&apos ...

A method for consolidating multiple enum declarations in a single TypeScript file and exporting them under a single statement to avoid direct exposure of individual enums

I am looking to consolidate multiple enums in a single file and export them under one export statement. Then, when I import this unified file in another file, I should be able to access any specific enum as needed. My current setup involves having 2 separ ...

Switch or toggle between colors using CSS and JavaScript

Greetings for taking the time to review this query! I'm currently in the process of designing a login form specifically catered towards students and teachers One key feature I'm incorporating is a switch or toggle button that alternates between ...

What's the best way to conceal the navbar while attempting to print the page?

Currently, I am working on developing an application for my school project. One of the features is an invoice sheet with a print option. However, when I try to print by clicking the button or using ctrl+p, the navbar appears in a chaotic and disorganized m ...

Is there a method to dynamically incorporate a new editable textfield row in a react table?

Is there a way to dynamically add an editable row of text fields to a table in React? Currently, when I click on the "Add" button, a new row is added to the table but it's not editable by default. The logic for adding a new row is implemented inside t ...

Every time I try to run a basic thread code, it causes the Firefox extension (nsIThread

Whenever I try to create a basic thread in Firefox (Aurora 30), it consistently crashes. The only action it performs is executing the function "task" from the thread. Any thoughts on what could be causing this issue? function task(a, b) { alert(a ...

Utilizing Ajax for dynamically updating a dropdown menu powered by Javascript

I have a question about implementing ajax in my category drop down box. Currently, I have a JavaScript function that redirects the page when a user selects a category. However, I would like to enhance this by loading the category items dynamically without ...

Add different input strings to an array within the scope when there is a change in the input value (AngularJS)

My goal is to populate an empty array within the scope with strings. The number of elements in this array can vary depending on what the user types in the player count input field. $scope.playerNames = []; To achieve this, I am using a $watch function th ...

The React app I've been working on has a tendency to unexpectedly crash when reloading the code from time

Dealing with a frustrating issue here. I've been working on an app and for the past few weeks, it keeps crashing unexpectedly. It seems to happen more frequently after saving my code to trigger a reload, but it can also just crash randomly while navig ...

Despite being capitalized, LINK_TEXT appears in lowercase in the browser's HTML code

When viewing the Treasury Department's interest rate statistics page, the link text 'DAILY TREASURY PAR YIELD CURVE RATES' is displayed in uppercase. However, when inspecting the HTML code in Chrome by using Ctrl-U, the same link text appear ...

What's the most effective method to incorporate additional events into this element using the conditional operator?

Looking for help with this code snippet: <span role="link" tabindex="0" :class="tabDetails.showPayment ? 'link' : ''" @click="tabDetails.showPayment ? cTab('payments') : null" ...