Having trouble confirming information within a modal with nightwatch js

There is an application with a pincode link that when clicked, opens a modal to input the pincode. However, I am experiencing difficulty entering the pincode inside the modal using nightwatch js. The application link is hometown.in

I have attempted

.waitForElementVisible('/html/body/div[7]/div/div/div/div/input', 3000) 

but it did not work.View a screenshot of the page HTML

Answer №1

If you want to improve the stability of your XPath, consider using a relative XPath.

.waitForElementVisible('input[placeholder='Enter Pincode / City']') 

Currently, this code only waits for the element to be present. To interact with it further, you should also input some text:

browser.setValue('input[placeholder='Enter Pincode / City']', ['3000', browser.Keys.ENTER]);

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

Selenium web driver is showing an error message: "*:-webkit-full-screen-ancestor" selector is invalid

Previously, this code was functioning correctly, but now when I run it, I consistently encounter an exception. The purpose of the code was to input a search query into the YouTube search bar and then click on the search button. Code: WebDriver driver = n ...

What steps should be taken for the authentication process when using Active Directory (with LDAP) with an AngularJS/JavaScript frontend?

Currently, I am tackling a project that involves authenticating users in an application using their Windows credentials. The frontend is built with AngularJS and the backend with Java. After conducting extensive research, I came to the realization that it ...

The React loader fails to function properly when used with nested routes

I'm currently working on my App.js file where I have defined all the routes for my application. I wanted to implement React-Router data loader functionality. import React from 'react' import { Routes, Route, Navigate, RouterProvider, createB ...

When TypeScript compiles without errors, the resulting JavaScript file still displays issues

As a newcomer to TypeScript, I decided to experiment with custom type declarations using this straightforward code snippet. The Code Here is the script I wrote: // app.ts type Customer = { name: String, isFrequentVisitor: Boolean, } type Order = { ...

What is the method for utilizing HSL instead of RGB in the global declaration of SCSS using the JavaScript API

This is how my next.config.js file is structured: // next.config.js const env = require('./site.config').env; const Colour = require('sass').types.Color; const {r, g, b} = require('./site.config').customProperties; const wit ...

Unable to properly align divs vertically

Having trouble getting some divs to align properly, whether they are in an accordion or not. The current layout is not what I want: My goal is to have them vertically aligned at the top, despite varying lengths. Any help would be appreciated. I attempted ...

What is the best way to update the state of a different component?

Snippet: var React = require('react'); var RecipeBox = require('./RecipeBox.jsx'); var AddRecipe = React.createClass({ handleClick: function () { RecipeBox.setState({ adding: false }); }, rend ...

Selenium WebDriver is mistakenly reporting an error for the Click action when in reality the Click was executed successfully

During our synthetic browser tests using Selenium and Google Chrome, we encounter a sporadic Selenium error (shown below) on a specific website. The flow typically involves: Loading the initial page Entering a search query Capturing a screenshot Clicking ...

Rewriting a JSON tree structure in NodeJS

Exploring a new method in comparison to my previous post. The situation involves a JSON structure as follows: var data = { "tree": { "id": "99842", "label": "Bill", "children": [ { "id": "27878", ...

After several interactions, the CSS files fail to load

I'm currently utilizing jQuery Mobile with 3 pages, and I've noticed that after navigating between the pages, the CSS is not being rendered properly. LoadCss.js $(document).on("pageinit",function(event) { $("#categoriesPage").on('pages ...

Is the unit-converts npm package compatible with the website https://unpkg.com?

Having issues importing the npm package 'convert-units' using unpkg, I attempted the following method: <script src="unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="02616d6c746770762f776c6b767142302c31 ...

"Everything is running smoothly on one REST endpoint, but the other one is throwing a CORS error

I am currently working on a project that involves a React client app and a Django server app. The React app is running on port 9997 and the server API is on port 9763. While the frontend is able to access some APIs successfully, there are some APIs that ar ...

Determine the present vertical measurement of the video

I am having trouble determining the actual height of a video element. Despite seeing in the developer tools that it is 384px, I am only able to retrieve a height of 342px. I attempted the following code snippet, but it only gives me the natural height, no ...

Highlighting table column when input is selected

I am working with a table where each <td> contains an <input>. My goal is to apply the class .highlighted to all the column <td>s when an <input> is being focused on. Additionally, I want to remove this class from all other columns ...

"Encountering issue with the find() function following a successful outcome

I am encountering some issues with my extension. In the following code snippet, I am using a find() function to extract data from an external page: $.ajax({ url: 'http://www.subspedia.tv/traduzioni.php', success: function(data) { ...

Having trouble with integrating user input from HTML into a JavaScript file to execute a GET request

I am currently working on a project to create a website that integrates the google books API for users to search for books. To start, I have set up a server using express in index.js at the root of the project directory, and all my static files are stored ...

Challenge implementing custom javascript to display categorical/string features on Shiny slider

I'm attempting to design a unique Shiny slider that represents the months of the year. My desired outcome is for the slider to display the names of the months as strings, rather than numeric values where 1 corresponds to January, 2 corresponds to Febr ...

Angular: When a user clicks, the text from the input fields is added to an array

Initially, I am a bit perplexed as I begin working on this task. I have a straightforward table where the data is fetched from a database and inserted into the DOM using Angular. The table comprises an option and its corresponding value. My goal is to all ...

Unable to trigger @click event on nuxt-link component within Nuxt 3

As per a Nuxt 2 question on Stack Overflow, it was suggested that the following code should prevent nuxt-link from navigating to a new page: <nuxt-link :to="`/meet`" class="group font-normal" @click.native="event => event.pre ...

Issue Encountered in NodeJS While Processing Multiple GET Requests

I have been developing a web application that utilizes a database containing game data. When a user clicks on a game, a GET request is made to an API to retrieve additional information for the selected game. My goal is to ensure that users can access detai ...