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
0
votes
1answer
43 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 ...
0
votes
0answers
16 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....
1
vote
1answer
169 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 ...
2
votes
2answers
411 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 ...
1
vote
1answer
346 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. ...
2
votes
2answers
601 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 ...
1
vote
1answer
124 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 ...
2
votes
2answers
306 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 ...
-2
votes
1answer
466 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 ...
1
vote
3answers
69 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()")...
0
votes
3answers
284 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) ....
0
votes
0answers
66 views

Selenium IDE - how do I 'click' custom Angular events?

I'm trying to test/debug an Angular app that generates a calendar (note: I cannot currently modify the application.) I believe the Angular calendar used is: Components / CalendarMonthViewComponent I'...
0
votes
1answer
55 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 ...
1
vote
3answers
240 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 ...
1
vote
1answer
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 ...
1
vote
1answer
731 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(...
0
votes
1answer
1k 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-...
0
votes
1answer
40 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=&...
1
vote
1answer
294 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 ...
0
votes
1answer
54 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 ...
1
vote
1answer
507 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.
0
votes
1answer
1k 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....
0
votes
2answers
367 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 = ...
1
vote
1answer
1k 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 ...
2
votes
1answer
59 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. ...
-1
votes
2answers
447 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.
1
vote
1answer
220 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('...
0
votes
0answers
85 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 ...
2
votes
3answers
237 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 ...
1
vote
1answer
1k 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 ...
1
vote
1answer
312 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). ...
1
vote
1answer
456 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 ...
2
votes
2answers
4k 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 ...
-1
votes
1answer
51 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 ?
6
votes
1answer
666 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 ...
2
votes
1answer
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 ...
0
votes
2answers
41 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 ...
1
vote
2answers
566 views

How to getText concatenating 2 strings in Protractor

I have 2 variables that get the texts: locationDisplayed and bindisplayed. I want the 3rd variable: expectedDescription concats the text of the first 2 vars. Here is the code: let locationDisplayed = ...
1
vote
1answer
31 views

How could I improve my page objects for this iterator assertion?

I am writing a e2e test for my front end web app with webdriver.io and node/javascript. Specifically, I want to improve my page objects. I have a dropdown that has two items(two rows of items) in a ...
3
votes
0answers
139 views

How to integrate and configure Polly.js with WebdriverIO?

So, I have been using webdriverIO. I noticed recently, there was support for puppeteer instead of using the typical selenium webdriver. I have configured my e2e tests to use puppeteer now instead ...
0
votes
1answer
682 views

Nightwatch JS - How to run multiple individual test cases?

Are there any other way to run test cases individually other than using --testcase flag ? also are there any to run 2 single test case from 2 different test suites? For example: Test Suite 1 Test ...
2
votes
1answer
157 views

Cypress + mochawesome-report undefined in consol

I have simple test to test mochawesome-report when I run it in terminal I have "undefined" multiple times during tests. How to remove it? undefined Sample test √ Passed 1) Failing ...
10
votes
2answers
548 views

Data driven testing using csv in Protractor

I am trying to run data-driven testing using csv file in protractor: I have created a read csv promise module: let readSync = async function (path1) { console.log(path1) const csv = ...
2
votes
2answers
196 views

Best strategy to test automatically a web application

I have an application that consist of a web server in Java EE (EJBs and JAX-RS RESTful services) and a client module in Angular that runs in a browser. The components that I can unit test ...
2
votes
1answer
2k views

How to access step definition variables using hooks.js

Hi in the below protractor-cucumber step-definition, I can modify the step definition variable a from before hook: "use strict"; let { Given, Before } = require('cucumber'); ...
4
votes
2answers
1k views

How to restart browser in protractor-cucumber framework or protractor-jasmine

I am using protractor-cucumber-framework, but when I try to restart I get This driver instance does not have a valid session ID (did you call WebDriver.quit()?) and may no longer be used. I ...
1
vote
0answers
221 views

How to automate Handsontable using Selenium WebDriver (Java)

I want to automate the Handontable using Selenium WebDriver using Java. Basically, I want to enter data in the handontable using selenium(Java). Is there any way available to enter data in the table. ...
4
votes
2answers
6k views

Code coverage for Selenium Tests

Is there any tool available to determine the code coverage for my selenium tests? My tests are written in Java having use of selenium WebDriver with BDD-Cucumber implementation in it.
1
vote
3answers
3k views

How to bring elements to view automatically in Protractor or selenium

I have a webpage to be tested which has a button at the footer of the page. When i click it, there should be an error message shown near to it. I was successful in automating this scenario but the ...
0
votes
3answers
597 views

Mouse hover action to browser window close button

I have a test scenario where the web application checks for the user's leave intent i.e., mouse hovering from the page to the browser close and then a frame gets triggered. Is there any way to do it? ...

1
2 3 4 5 6