Why won't my test in WebdriverJS and Jasmine redirect the browser to the intended URL?

Currently, I am executing a test suite with the following setup:

  • nodejs
  • selenium-webdriver
  • jasmine-node (utilizing jasmine 1.3)

Upon running the spec provided below, the browser window initializes but fails to redirect to the specified URL - instead, it remains idle until the test times out.

// UpdatedTestSpec.js
var webdriver = require('selenium-webdriver');

var driver = new webdriver.Builder().
    withCapabilities(webdriver.Capabilities.firefox()).
    build();

jasmine.getEnv().defaultTimeoutInterval = 10000; 


describe('basic test', function () {
    it('should navigate to correct page', function (done) {
        driver.get('http://www.google.com');
        driver.getTitle().then(function(title) {
            expect(title).toBe('Google');
            done();
        });

    });
});

I am seeking assistance on how to ensure that the browser redirects to the intended URL as expected.

Answer №1

Have you attempted a similar approach like this:

const driver = new webdriver.Builder()
    .forBrowser('chrome')
    .build();

You can find more guidance in this article:

Answer №2

If you are looking to utilize Chrome browser within a NodeJs environment, consider implementing the following code snippet:

let driver = new webdriver.Builder();
driver = await new Builder().forBrowser('chrome').build();

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

Establishing a server-side connection with Socket.io using Node.js

In my Node.js application, I have a frontend app and a backend app. The backend is responsible for managing the list and pushing updates to the frontend app. When I make a call to the frontend app, it triggers a list update so that all clients receive th ...

Validation for nested fields in objects using express-validator if the object exists

I am currently working on a Rest API Project using Express and NodeJs, with the addition of Express-Validator for request object validation. Within one of my services, the request body looks like this: { "name": "some value", " ...

Ways to verify whether a string has already been hashed in Node.js utilizing crypto

I am currently working on an application that allows users to change their passwords. For this project, I am utilizing Node.js along with the mongoose and crypto libraries. To generate hashes for the passwords, I have implemented a hook into the model&ap ...

The compatibility issues, absence, or failure to assign property entities in NestJS Prisma

Trying to update the Postgres database with Prisma ORM in NestJS (Microservices architecture) includes allowing users to interact with invitation requests. However, encountering the error message: Argument of type 'Invitation' is not assignable t ...

Exploring React JS Subdomains

I have been developing a MERN application that needs to support dynamic subdomains for each company, like companyname.localhost. In order to make this work, I made an adjustment in my .env file with the line: DANGEROUSLY_DISABLE_HOST_CHECK=true After a us ...

npm must patiently wait for a port or command to be ready before moving on to the next task

Currently in my npm package, I have this script: "start": "concurrently --kill-others \"npm run dev\" \"electron .\"" The issue is that when electron runs its command, the server isn't up yet so it displays a blank screen. I reso ...

What is causing the delay in retrieving elements using getX() method in Selenium?

Recently, I've been experimenting with web scraping using Selenium. However, I've noticed that there is a delay when calling getText(), getAttribute(), or getTagName() on the WebElements stored in an ArrayList from the website. The website I&apo ...

node index of data that has been posted

My HTML file is quite straightforward: <form method="post" action="http://localhost:3000/post"> <input name="name" type="text"/><br /> <input name="last_name" type="text"/><br /> <button id="submit" type="submit"& ...

Node.js: Extract the object's name and value that are sent from the frontend

I'm in the process of creating a microservice using nodejs. The request is returning the following JSON. { "distCd": "abcd", "distName": "parentLife Distributor (TOD)", "stateCd": "", "subdistInd": false, "maindistInd": true ...

Encountered a problem during the installation of Selenium using pip3

I'm encountering issues while trying to install selenium. After running pip3 install -U selenium, I received the following error message: Exception: Traceback (most recent call last): File "/usr/local/lib/python3.5/site-packages/pip/basecomman ...

Element cannot be located using XPath Selector for a text type without a corresponding name or Id

Browser Inspection Tool https://i.stack.imgur.com/jsOeJ.png An Example in C# IWebElement Search = driver.FindElement(By.XPath("//*[@placeholder='search' and @type='text']")); Actions actions_Search = new Actions ...

Sequelize: Query results do not have defined instance methods and properties

The Sequelize version is 6.6.2 Mysql2 version: 2.2.5 I have constructed my Model in the following manner and defined methods as shown: interface IUserAttributes { user_id: number; logon_name: string; user_password: string; full_name: string; di ...

Is it possible to adjust environment variables during runtime in a live production environment for a rails application?

I am currently developing a web application that focuses on automating CRUD tasks on Amazon. This includes the ability for users to delete and add addresses on their Amazon account. To automate these tasks, I am utilizing Selenium WebDriver with a Mozilla ...

Multer is experiencing difficulties in uploading files, yet it is not displaying any error messages

When setting up an application to create courses with images, I encountered an issue while using multer for image uploading. Despite adding multer to my route with upload.single('images'), the uploaded images were not appearing in the designated ...

Node is throwing an error that it is unable to find the view "index" in the "views" directory, which may vary depending on the current directory in the shell

During the development of my Node.js project, I encountered an issue with running my index.js file. Specifically, when I navigate to the root directory of my project and execute $ node index.js, an error is raised stating: Error: Failed to lookup view " ...

Automate the process of creating and saving files directly to my computer's local disk with Selenium

My Report Generator is an intranet web application that creates around 100 PDF and Excel reports daily. It's crucial to ensure that all these reports are generated without any errors, but the manual checking process takes up to 200 minutes due to each ...

[AWS Lambda SDK] - Executing Lambda Function - Processing Payload Response as Unit8Array - Conversion to String

Currently, I am utilizing the npm package @aws-sdk/client-lambda to invoke Lambdas. In my setup, I have two Lambdas - Lambda A and Lambda B, with Lambda A responsible for invoking Lambda B. The invocation of Lambda B from Lambda A is done through the foll ...

next-auth consistently redirects when encountering errors with credential providers

I've been working on integrating next-auth with my next js app using the Credentials provider. However, I'm facing an issue where every time a login fails, it automatically redirects to the /api/auth/error route. What I actually want is to handle ...

Having difficulty implementing pagination functionality when web scraping using NodeJS

Currently, I am creating a script that scrapes data from public directories and saves it to a CSV file. However, I am encountering difficulties when trying to automate the pagination process. The source code I am using includes: const rp = require(' ...

Error Encountered: "Attribute Error with Selenium in Firefox 61.01 64 Bit using Python 3.6 (32-bit)"

I'm in need of assistance. My program works flawlessly until it reaches an error with the "assigned to" field. I have reviewed the code and cannot identify any issues with it. The field type is assigned group, and it is properly populated with the wri ...