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
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
559 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? ...
0
votes
3answers
207 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
1answer
19 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 ...
3
votes
3answers
27k views

How to verify response body as a test in postman

I want to verify the response data as a test using Postman. For example, given the response below: { "data": { "id": 2, "first_name": "Janet", "last_name": "Weaver", "avatar":"...
0
votes
2answers
530 views

Getting error when I run my test using mocha

I have written a code where it will launch the app, click on the login button, enter username and password and click on sign in. When I run this using node 'filename' it is running fine with no issue....
1
vote
1answer
68 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 ...
0
votes
0answers
14 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....
0
votes
2answers
3k views

How to reliably click bootstrap dropdown with no button element?

I am using Selenium to try and select an element in a bootstrap dropdown menu, but there is no button element present. The website uses all JavaScript to enable the dropdown. The HTML code for the ...
2
votes
2answers
317 views

Postman API test structure

Recently I started writing tests for our API. However, I have faced some issues which I think it is critical to think at the start. How should I structure my tests in terms of setup and cleanup phase (...
1
vote
1answer
86 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
195 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 ...
1
vote
1answer
195 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. ...
1
vote
2answers
205 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 ...
0
votes
2answers
342 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 = ...
0
votes
1answer
150 views

Able to find xpath, but trying to click button throws exception

I tried to click on an element using the code below but it is throwing Exception: No Such Element Selections WebElement clear=driver.findElement(By.xpath(PageUtility.OPEN_LOCATION_POPUP_XPATH)); ...
0
votes
1answer
1k views

When I run my appium script I am getting error “TypeError [ERR_INVALID_ARG_TYPE]”which I am not able to understand

I wrote a script to automate my app using appium with java-script(nodejs), but when I run it I am getting error. This is the code which I have written. var webdriverio = require('webdriverio'); var ...
1
vote
2answers
2k views

Nightwatch: Timed out while waiting for element to be present. - expected “found” but got “not found”

Using Nighwatch's POM below is a page function to click a button, page needs to be refreshed and validate if element present. using this.api.refresh() to refresh the page. But waitForElementPresent ...
2
votes
2answers
433 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 ...
0
votes
1answer
62 views

Fetch paid Amount value from iframe

if(ScenarioName.equals("MoveinwithVantivCard")) { driver.findElement(By.id("btnsave")).click(); // driver.switchTo().frame("paymentIFrame"); driver.switchTo().frame(driver.findElement(By....
1
vote
3answers
169 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
625 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(...
6
votes
2answers
10k views

PROTRACTOR:How to tell protractor to stop or skip the TEST if any Test case is failed

Current Behavior: If any TestCase is Failed, Protractor not continuing with the next Testcase and holding to the same failed Testcase . Waits for long time and throws A Jasmine spec timed out. ...
1
vote
2answers
5k views

How to upload an image selenium webdriver with javascript?

driver.wait(until.elementLocated(webdriver.By.css('div.border-right:nth-child(2)')), 1000) .then((element) => { element.click(); }); I am using java-script for my test cases. I had an issue to ...
0
votes
1answer
68 views

Is it possible to use Microsoft UIA to automate sites designed in Angular?

I am trying to automate UI for a site designed in Angular and when I inspect the browser (Chrome) with UISpy.exe, I find that certain controls do not exist in the tree at all, even though I can see ...
-2
votes
1answer
327 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 ...
3
votes
3answers
7k views

Unable to open Chrome WebDriver in another language

I'd really like to write a Selenium WebDriver test that verifies text is localized. The localization code bases the strings it displays on navigator.language (or navigator.userLanguage for IE). I ...
1
vote
3answers
63 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()")...
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. ...
0
votes
1answer
51 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 ...
0
votes
0answers
51 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
4k views

PROTRACTOR: Right click on link and open in NEW TAB

TestCase: Right click on link element and open in NEW TAB or NEW WINDOW. I could able to right click on the element using the below code. But not sure how to select the option of "OPEN Link in ...
5
votes
2answers
5k views

Can developers easily add IDs to a React app?

I am writing Selenium automation against a React application. I would like to have unique IDs added to page elements I am testing. I asked the developers but their response was that this was hard to ...
1
vote
1answer
249 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 ...
1
vote
1answer
25 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 ...
2
votes
1answer
4k 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 ...
36
votes
11answers
17k views

Why should a software QA engineer need to learn JavaScript?

I've seen in lot of job advertisements, companies asking for JavaScript knowledge for QA. So my questions are: What is the use of JavaScript for QA? If JavaScript is used for testing, what kind of ...
1
vote
3answers
396 views

Alternative to browsershots.org for taking screenshots on multiple browsers on different platforms?

I'm working on a project where I have to test a javascript library's compatibility on mobile platforms in different browsers on the most recent versions of different mobile browsers. I have been long ...
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=&...
3
votes
0answers
182 views

When and where does Intern.js opens browser and how to open a new browser by using intern script

I'm trying my hands at intern.js to automate my UI test. And I want to some test to run on a separate browser, i.e open new browser run test run test close browser and so on but I'm unable to figure ...
1
vote
1answer
441 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 ...
0
votes
1answer
48 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 ...
2
votes
1answer
5k views

Protractor - How to use async/await

I am completely new to protractor, and I came across the async/await. Using: node version 8.9.4 protractor version 5.3.0. Is it necessary to use async/await in all your script? And how to use with ...
1
vote
1answer
511 views

Protractor - How can I bypass the mixed content error

I am getting the below error when I was trying to approve a document in a webpage Mixed Content: The page at \'https://example.com\' was loaded over HTTPS, but requested an insecure resource \'http://...
2
votes
2answers
2k views

Protractor: Iterate through table <td> and click the link by TEXT

Requirement : link is present inside table >td>p>a. I want to click on link by TEXT (something like contains(Text)) Tried: by.CssContainsText("a","Text") . I did not work, ...
3
votes
2answers
292 views
0
votes
1answer
683 views

Protractor - javascript isPresent always returning TRUE

So, I am accessing an application. There are multiple employee records. However, there are no duplicate records. I am deleting an employee record and then trying to verify that the employee record has ...
2
votes
3answers
6k views

Scrolling to Bottom of the Text Area using Protractor

I have a text field that I need to scroll to the bottom of in order for the Next button to be activated to click. This project is using Angular 6 my tests are end to end test running on the protractor/...
1
vote
2answers
542 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
2 3 4 5 6