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
0answers
14 views

how to find text of span tag. so if a tag is called newTag, I would like to upload a certain image to take me to a certain link [closed]

function myFunction() { Var example = Nav.Document.GetElementsByTagName("span"); alert(example); } <span class="tagged_as">Tags: <a href="http://localhost:...
0
votes
1answer
32 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=&...
0
votes
1answer
74 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
33 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
60 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
116 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
1answer
85 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
145 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 ...
1
vote
1answer
43 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
61 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
44 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
19 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
63 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
466 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
137 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
149 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
1k 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
16 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
576 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 ...
1
vote
1answer
1k 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
32 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
264 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
26 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
83 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
268 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
127 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
424 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
171 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
680 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
607 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
147 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
3k 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
2answers
1k 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
274 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
vote
1answer
180 views

Selenium: Capture DOM Elements Image

I have an API to capture the image of a particular element in DOM and return them. For that, I have a list of WebElements which needs to be captured into a single webpage. For that same, I have found ...
0
votes
0answers
29 views

Driver does not recognize pop-up's - can not switch

In years it is the first time I saw something like this, when I do a: config.getWebDriver().getWindowHandles().size() The result is always 1, but in fact, there is a main window opened and after a ...
0
votes
1answer
71 views

Verifying that a pdf is correctly displayed using new relic synthetics [duplicate]

I have created scripts in new relic synthetics that verify the web application is still behaving correctly. This script does the following things: go to the specific page click on a pdf link ...
1
vote
2answers
222 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
42 views

Selenium to test Dygraphs

Is it possible to use selenium(C# bindings) to write automated tests for testing Dygraph charts? If selenium does not support this? Are there any other tools which can be used? http://dygraphs.com/ ...
3
votes
2answers
2k 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 ...
0
votes
1answer
960 views

Compare the date from a API key value in Postman

I have a scenerio where I need to compare a date from an API response with today's date and check whether it is less than or equal. The API response will give me a JSON object and in that JSON the ...
0
votes
0answers
687 views

Use tv4 to validate schema in postman

I am trying to validate a scheme using tv4 in Postman, but no matter what I do it always passes - even if I force bad data. I am unsure if I am doing something wrong or if there is an issue with tv4 - ...
-1
votes
1answer
27 views

automated retrieval of account creation email

I'm looking to test an account-creation feature of my product. The back-end of my application (which I do not control, so I can't intercept the sending of the email) sends an email to the address of ...
0
votes
1answer
1k views

Reset state before each Cypress test - TypeError: cy.resetDb is not a function

I use Cypress with my local web app. I followed install and run instructions: https://github.com/gothinkster/react-mobx-realworld-example-app Tests work fine until I wanted to reset database state ...
0
votes
1answer
813 views

Waiting for a scroll to be over

I have this function who scroll an element into view and then click on it: private void iClickOnElement(WebElement element){ WebDriverWait wait = new WebDriverWait(driver, 10); ...
0
votes
0answers
46 views

Open a clickable link on a web page and take the screenshot at the same time

I'm new to chrome headless and I have a problem. I want to randomly select two links from a web page on the page being viewed and open them at the same time. Indeed my goal is to be able to have the ...
0
votes
1answer
581 views

change attribute value using selenuim python

I am try to change non input attribute value in Firefox frame in the format: <div id='100' class='abc'> <p> hello </p> </div> <div id='200' class='abc'> <p> hello ...
-1
votes
2answers
399 views

Getting error in selenium with node.js automation

I am working on automation. I am using Selenium with nodejs code. I am just beginning to learn selenium with nodejs. I am trying to open a application, but I am getting error. Here is my sample code.....
0
votes
2answers
57 views

Which is faster: creating a method to reference a web element by label text, or directly referencing the element via a UI?

The automation framework I'm working within has a method in the PageObject file to return a WebElement by its label text: getSubTab : { value : function(value){ return this.navTabs.filter(...
0
votes
2answers
1k views

Unable to enter text in Twitter using Selenium Webdriver

I'm trying to automate Tweeting using Selenium Webdriver in Chrome. I can login and click the Tweet button, opening the Compose new Tweet box, but when I try to enter text with element.sendKeys(...

1
2 3 4 5 6