Questions tagged [javascript]
JavaScript is a dialect of the standardized ECMAScript programming language, primarily used for scripting web-pages.
316
questions
0
votes
0
answers
11
views
What is the best way to set up multiple tests on one webpage with Selenium Webdriver and Cucumber JS?
I am new to automated testing, Selenium and Cucumber.JS and am trying to set it up in Node.JS to run several tests on my website.
I have gotten single scenarios/test working fine, but I am a bit ...
-1
votes
1
answer
79
views
getting this error AssertionError: expected undefined to deeply equal 'open_group'
const jsonData = pm.response.json();
pm.test("Status code is 200", function () {
pm.response.to.have.status(200);
})
//each month on the payment day, next_cycle is updated
pm.test("...
0
votes
0
answers
162
views
How to send a multipart/form-data request in cypress which having xml file
I'm having a POST request which have multipart/form-data content and data in xml like below
userlist: "
<user id="[email protected]" password="Password1" path="sysadm/...
0
votes
1
answer
15
views
Visual representation of an element I am clicking in VS Code
I think remember reading this somewhere but cannot remember if it is true or not. Is there a VS Code extension that will let you visually see on the web page (or in VS Code) where exactly the mouse....
0
votes
0
answers
22
views
Auto suggestions missing for built in locators like goto, click, fill in Playwright Javascript
I am doing playwright java script automation using POM cucumber BDD framework.
I initiated page object in Hooks file.
If I want to access that page object in another methods in the same file it is not ...
0
votes
1
answer
332
views
How to reset app between tests in WDIO?
I'm currently trying to get WebDriverIO working with Appium and Mocha (BDD) towards an Android device. Previously when I've worked with Mocha the behavior has been that testcases are isolated from ...
-1
votes
1
answer
876
views
Cypress API testing : How to login and then use the auth token in another test?
How can I access the token generated from 1st it block to 2nd it block.
here is the code:
1st it block
it('Login using new user', () => {
cy.api({
method: "POST",
...
1
vote
1
answer
363
views
How can we validate the response body using Tests in postman
Request Body
{
"StudentInfo":{
"Student":[
{
"StudentId":"001"
}
}
}
Response Body
{
"Studentinfo":{
"Student":[
{
"StudentId":&...
-1
votes
1
answer
93
views
Populate a field with value from another field based on xpaths using javascript
I'm trying to read a value from a dynamic text field (value is updated on each visit) based on the xpath and pass it in the field below.
The page validation is the match between those two fields based ...
0
votes
1
answer
78
views
Will Selenium Webdriver become less popular in coming years? [closed]
Lot of Automation engineers have shifted to new Web automation tools like Cypress, WebDriverIO, Pupeeter, Playwritght, Katalon Studio, AI tools like Testium, Functionize etc and i am still working on ...
0
votes
1
answer
58
views
What aspects of javascript are relevant for Selenium Automation (with Java bindings)?
I use Java and Selenium for my automation framework. However, sometimes, as per need, I have to use JavaScriptExectutor in my script. But I have never studied JS and no nothing about it. If someone ...
-1
votes
2
answers
76
views
How would you prioritize these bugs, and why? [closed]
Here is a hypothetical scenario for a software quality assurance (QA) logical question:
You are a QA engineer testing a new feature for a web application. The feature allows users to upload and share ...
0
votes
2
answers
56
views
Scrolling using the same code is working 7/10 times
With same code I have tried scrolling, firstly I scrolled to bottom then top and then to element so that element can get loaded properly even though sometimes testcases are failing due to scrolling
...
1
vote
2
answers
1k
views
How to get body data in logs for each request in K6
I would like to know: how can I get the body data in response to each request in K6?
I tried using console.log(response.body), but it did not provide a solution for it. Either it gives a response in ...
-2
votes
2
answers
3k
views
Getting javascript error: element is not defined
I am trying to verify carousel has auto flash and manual selection options. For manual option I checked the slick dots are clickable. For auto flash option I am checking the style animate-repeate is ...
1
vote
1
answer
3k
views
Verify read-only fields using cypress
I have a few text fields which when I login as a specific user (rights of a read only) , all the text fields are not allowed to be edited.
I am trying to automate this page in Cypress.
I tried using :
...
1
vote
1
answer
693
views
Can not sendKey to hidden element
I'm practicing to interact with element (nopCommerce domain).
But encountered some problems, when trying to perform sendKey to an invisible element.
This is an input field of product tags, which ...
2
votes
1
answer
226
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.
<...
1
vote
0
answers
529
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 ...
0
votes
1
answer
125
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-...
2
votes
1
answer
249
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 ...
0
votes
2
answers
464
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" ...
-1
votes
1
answer
95
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 ...
0
votes
1
answer
76
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....
0
votes
0
answers
1k
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 ...
0
votes
1
answer
2k
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=&...
1
vote
1
answer
2k
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, ...
0
votes
0
answers
273
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 ...
1
vote
1
answer
452
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 ...
0
votes
1
answer
610
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
0
answers
126
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....
3
votes
1
answer
8k
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
2
answers
12k
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 ...
4
votes
1
answer
11k
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
3
answers
3k
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
1
answer
1k
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
2
answers
6k
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
1
answer
2k
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
3
answers
517
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
3
answers
2k
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
1
answer
340
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
3
answers
2k
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
1
answer
27
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
1
answer
2k
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(...
2
votes
2
answers
5k
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:[email protected]/meat/meat-...
0
votes
1
answer
348
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
1
answer
1k
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
1
answer
153
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
1
answer
3k
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
1
answer
3k
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....