Questions tagged [javascript]

JavaScript is a dialect of the standardized ECMAScript programming language, primarily used for scripting web-pages.

Filter by
Sorted by
Tagged with
1 vote
1 answer
20 views

Scrollbar value returns false even though it is present

I have a pop up which enables a scroll bar depending on the element count it contains. Right now there are more than two elements and scroll bar is present. Below is my html view of the pop up. <...
user avatar
0 votes
0 answers
3 views

Unable to scroll into view of an element in iOS with Appium & Webdriverio

i'm trying to scroll into an element but the the current code scrolls all the way to the bottom of the page, i have inserted the element name within the code but it doesn't seem to work. const ...
user avatar
0 votes
1 answer
28 views

Element is not clicked even after explicit wait

I am trying to verify default selected value of a dropdown. <div class="p-3 p-md-4 mt-4 mt-md-4 card"><div class="row"><div class="d-flex align-items-center col-...
user avatar
1 vote
1 answer
20 views

Verifying scrollbar is present script fails

I'm trying to check whether a scrollbar is present when there are more than 2 elements in a pop up. Here is the HTML code for the div which enables the scroll bar if when there are more than 2 ...
user avatar
0 votes
2 answers
27 views

Button click was not performed even though element was found

I'm trying to click below button. <button class="MuiButtonBase-root MuiButton-root jss47 jss58 MuiButton-contained jss48 jss59 MuiButton-containedPrimary MuiButton-disableElevation" ...
user avatar
-1 votes
1 answer
13 views

Looking for Javascript coding challenge Websites. Can you guys help?

I really need to improve my JS coding (currently learning ES6) as it would be great for my automation Testing. I would like to take a daily coding challenge (min 30 days) but I'm having difficulty ...
user avatar
  • 419
0 votes
1 answer
24 views

Different boolean results for same scenario - selenium java

I'm trying to verify whether profile image is present after uploading an image. Image uploads successfully. I have try to verify image with two different ways. profileImage= driver.findElement(By....
user avatar
0 votes
0 answers
12 views

how to mock/test a window.prompt feature using sinon.js

I have a javascript function hat uses prompt ask details from user: export function askUserForTeamDetails() { const emoji = window.prompt( 'Enter new team’s emoji:' ); if ( null ===...
user avatar
0 votes
0 answers
204 views

How to display the number of pages in Pagination WebTable using Selenium Webdriver

I wan to display the number of pages in count in Pagination WebTable using FOR Loop, please find the code of FOR Loop condition. But not able to display the total number count of pages. When clicking ...
user avatar
0 votes
1 answer
332 views

Cypress: cy.type() requires a valid time with the format with the format HH:mm, HH:mm:ss or HH:mm:ss.SSS

I am automating using cypress, there is a time input in the application. The html of it as follows: <label>Time</label> <input data-testid="time" type="time" name=&...
user avatar
  • 139
0 votes
1 answer
277 views

Testing Stripe payment integration using Cypress

We've recently implemented Stripe for customers to checkout. However, using Cypress to automate our regression tests was incredibly painful as the fields are inside an iframe (and, for some reason, ...
user avatar
  • 2,442
0 votes
0 answers
32 views

How to send text to shadow element using javascript in selenium Java

Element is inside shadowroot. Both ways not working Can anyone help here. Shadow element stored in element named variable and need to enter text in the description field. driver.executeScript("...
user avatar
0 votes
0 answers
95 views

FIle Upload in WebdriverIO with AutoIT

I am trying to upload a file in a file upload filed in WebdriverIO with AutoIT. I am unable to execute the .exe file which will select the file from File Explorer in Windows. Can anyone tell me what ...
user avatar
1 vote
1 answer
66 views

How can I find all values between strong brackets from a javascript website using Selenium?

I'm trying to scrape a javascript website. The website contains a list of products and I need to find out a specific product through this list. All product names are between strong brackets from an ...
user avatar
  • 11
0 votes
1 answer
152 views

Unable to locate pseudo element using javascript executor in Selenium JAVA

I am currently having issues with locating an pseudo element for a web page. I have checked other articles to use javascript and tried but it still isnt getting it. Below is a screenshot of what the ...
user avatar
0 votes
0 answers
25 views

MatcherAssert fails on popup modal

I have a script that goes to a page, clicks a button and then uses a MatcherAssert to check I am getting the right messaging on a gating modal. Here's the script: package com.lbr.testcases.lexology....
user avatar
2 votes
1 answer
2k views

Playwright: Working with Bootstrap modal dialogs/popups

So I have been facing some issue with some of my tests which require a user to Confirm or Cancel a Bootstrap modal dialogs/popups windows. It seems that each time when I try to interact with a Confirm ...
user avatar
2 votes
2 answers
5k views

Playwright: Creating and interacting with a list of elements on the page

This might be a simple question, however I would like to know if there is a simple way of declaring a list of elements which later on you will be working on for example looping through it and looking ...
user avatar
2 votes
1 answer
3k views

Playwright: Printing Console Logs each time when one of the test fails

I am working with Playwright, Mocha and Chai for my automation project and I was wondering if there is a way for capturing all console logs that appear during a failed automation test execution. ...
user avatar
2 votes
2 answers
2k views

Playwright: Implementing Page Object Patter into Framework

Recently I have been asking questions regarding Playwright and so far the community has been very helpful. I hope that my question and answers provided will be in use for people who are just starting ...
user avatar
1 vote
1 answer
471 views

Playwright: Executing different test suites depending on script parameter

I have switched to Playwright recently and I would like to ask you for some feedback on my current issue which I am facing at the moment. I have a simple framework set up for one of our company ...
user avatar
2 votes
2 answers
2k views

Playwright: Storing an element selector in variable

This might be a trivial question/answer, however I would like to know if there is a way that I could store an element locator in a variable and then reuse it same as it while working with Selenium and ...
user avatar
-2 votes
1 answer
1k views

Return multiple variables from custom command in Cypress

What I am trying to do: I have a custom command, inside which i am declaring few variables(boolean). I am setting the values for the variables as per my code. I wanna use the variables to assert in ...
user avatar
1 vote
3 answers
187 views

(Google Chrome Extension) I want to click a link on a page but they all have similar hrefs

I want to click a link on a page but they all have similar hrefs This works for clicking the first link Code: await executeScript("document.querySelector('a[href*="/p/"]').click()")...
user avatar
0 votes
3 answers
943 views

TypeError: driver.actions(...).move is not a function

I am writing a selenium test in Javascript, where I want to move/hover cursor over a particular element. I tried bunch of things, but nothing seems to work - 1. driver.findElement(selector) ....
user avatar
0 votes
1 answer
134 views

How to check in the page if the name exists and then increment a unique name

I have a scenario where I need to add new username everytime is run the script. For instance, if the last time I had added a name as test1, then next time when I add another name I should not add ...
user avatar
  • 23
1 vote
3 answers
789 views

Breaking a loop after resolving a promise

I am writing a program to check the health endpoint of one of our APIs. So, before starting execution, I try to hit the health endpoint 5 times. If I get the desired response code during the 5 ...
user avatar
  • 1,712
1 vote
1 answer
26 views

Should cross-browser and cross-platform be performed for testing network calls from a website?

My team is implementing Adobe Analytics on a web site. We have three layers where it should be tested. Adobe Data Layer. The required variables and their values are added to an object handled by a ...
user avatar
  • 562
1 vote
1 answer
1k views

File download verification with selenium and java

So I read all the other stackoverflow topics about this, none of the solutions worked for me so lets see if someone can help me. I need to verify a download (csv) from an export button in chrome(...
user avatar
1 vote
1 answer
3k views

How to get cookie value in cypress from a cy.request response?

I am using the following before my test to try and get a cookie value from the request cy.request({ method:'GET', url:`https://test:test!@mf-test-magento19.test.com/meat/meat-...
user avatar
0 votes
1 answer
88 views

After applying the color to the button element, the color property of an element returns null

I am trying to get the color property of the button element using Javascript inside Selenium, before and after clicking the button. HTML code: <html> <head> <meta charset=&...
user avatar
1 vote
1 answer
655 views

WebDriverIO executing too fast

I think this is weird, as I have been researching and most of the questions related to WebDriver execution time are about it running slow. However, the problem is that the page which I'm testing is ...
user avatar
  • 11
0 votes
1 answer
83 views

Assert that options (text) in drop down are unique

I’m creating test in cypress using typescript, I’m not sure how to assert that all options in drop down are unique - I found bug where is situation that values are duplicated multiple times - it’s a ...
user avatar
1 vote
1 answer
1k views

How to re-run jest failed test suite [closed]

I want to re-run the whole test suite when any test has status failed. I only found how to re-run the test case but I want to re-run the whole test suite.
user avatar
0 votes
1 answer
2k views

Unable to fill the card details for Payments using Selenium at the merchant's checkout page

I have just started learning Selenium web automation tool and wanted to auto-fill the card details on the merchant's Payment Page but unable to do so using Selenium. Below are the things which I tried....
user avatar
0 votes
2 answers
674 views

Fixing an asynchronous JavaScript timeout out issue with Selenium in C#

Background I am running the following JavaScript code using the C# bindings for Selenium: async function addTableCellClassInjector(row, tableIndex, rowIndex) { for (let columnIndex = 0; column = ...
user avatar
1 vote
1 answer
2k views

Generating SRP_A for AWS Cognito user login for a performance test script using JMeter

I am trying to test a Guidewire application that uses Cognito for user portal Login authentication. A Javascript is downloaded, at the application launch, that is generating SRP_A string There are a ...
user avatar
2 votes
1 answer
65 views

Selenium WebDriver - Unable to identify if radio option is selected or not - contains pseudo elements

I am having hard time with identifying if radio option No is selected or not using Selenium Java. Below is the screenshot of the radio options on the web page. A workable solution is much appreciated. ...
user avatar
  • 21
-1 votes
2 answers
705 views

How do I verify a value from a CSV file using Postman test [duplicate]

I'm using Postman to push data from a CSV in my Google cloud bucket to an app. I need to write a test to verify that one of the values in the CSV is all in uppercase.
user avatar
1 vote
1 answer
308 views

Hooks not getting executed in protractor cucumber

I new to protractor, and trying to implement hooks. But the hooks are not getting executed. Following is my code: Hook.js: const { Before } = require('cucumber'); const {AfterAll} = require('...
user avatar
0 votes
0 answers
294 views

How to add the number of times a test needs to be run in webdriverio and javascript

I would like to repeat a test run multiple times. So I would like to add the count to the command we are passing to run the test. I tried adding the option to grunt file but is not working Command ...
user avatar
  • 111
2 votes
3 answers
404 views

Is there a way to capture Jasmine assertions?

Is there a way to capture expect failures in Jasmine? This doesn't work, the exception is not captured. try { expect(1).toBe(3) } catch (e) { } I am looking for something like this TestNG ...
user avatar
  • 10.8k
1 vote
1 answer
2k views

Passing global variables to Newman (Postman) from Jenkins

I have a Postman Collection with Global Variables that I am running via Jenkins (successfully), but I want to expose choices for the variables as Choice Parameters within Jenkins. I asked an initial ...
user avatar
  • 373
1 vote
1 answer
420 views

Exposing Postman Global variables as Jenkins Choice Parameters

I have a postman collection which I have managed to run from Jenkins using Newman. I have a groovy pipeline in which I install the dependencies included in my package.json (Newman in this case). ...
user avatar
  • 373
2 votes
1 answer
658 views

Typescript function not waiting for the waitForExist() and printing the next line

I'm using webdriverIO with typescript and jest to automate react application. I have a simple test to check how long it takes for a particular element to display on the screen. There's a process ...
user avatar
  • 49
4 votes
2 answers
5k views

How to query the Canvas using Selenium with JavaScript Executor or Protractor?

I like to know if it's possible to automate this 'graph' which is created on the canvas, if yes, how to automate it. I have to interact with all the elements on the 'graph or a map like thing' by ...
user avatar
-1 votes
1 answer
58 views

What are some simple eslint defaults that can help improve app code and test code quality?

I use mocha/chai and my .eslint file is in YAML. What eslint settings could I apply to most projects, i.e. use as a template ?
user avatar
6 votes
1 answer
775 views

How to approach setting up test data for a project that has a microservice architecture?

I have to integrate API test-automation on a project that has a microservice architecture. Each back-end service has a different repository and is deployed separately. I haven't had the opportunity of ...
user avatar
2 votes
1 answer
5k views

If else loop is not working/ element exists: cypress automation

I am new to cypress. I read some of the other if-else cypress related questions and yet fail to understand whats wrong with my code. What I am trying to accomplish: if "There are no results" found on ...
user avatar
  • 139
0 votes
2 answers
65 views

Headless mode buttons are hidden - I think the side drawer is closed?

Using webdriver.io and chrome for e2e test. In the browser GUI the test runs fine. But with headless chrome it complains about not finding buttons in the left side nav bar. I think in headless the ...
user avatar
  • 127

1
2 3 4 5
7