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
15 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). ...
0
votes
0answers
5 views

Importing files and images in blueJ on a mac

I do not know how to get my file or image in bluej on a mac. I know all the correct coding, but it does not work. My teacher told me she only knows how to do it on a windows, so I am pretty much ...
1
vote
1answer
18 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
75 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
14 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
547 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
98 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
28 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 ...
0
votes
2answers
57 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
23 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 ...
1
vote
0answers
29 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
0answers
30 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
79 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 ...
8
votes
2answers
231 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 = require('csv-...
2
votes
2answers
152 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 ...
1
vote
1answer
99 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'); let a=...
4
votes
2answers
137 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
91 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. ...
3
votes
2answers
504 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
249 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
107 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
0answers
51 views

How to call driver in Javascript Webdriverio Appium test

In the Webdriver.io and Appium docs they mention using the driver object to perform tasks (like launching an app) but I don't know where or how to use this object. I tried writing it in the test (as I ...
1
vote
1answer
79 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
28 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
61 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
132 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
33 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
412 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
268 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
388 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
24 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 ...
-1
votes
1answer
674 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
441 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
40 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
183 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
251 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
55 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
726 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(...
2
votes
1answer
2k views

How to handle SSL certificates in chrome using Selenium?

I am trying to post something on facebook using selenium. But after successfully logged in, i am getting SSL certificate to allow or block the notification of Facebook. I am not aware how to handle ...
0
votes
2answers
83 views

Capture arguments of onclick() javascript call using Selenium Java

I am writing a selenium script in Java to capture the arguments passed in JavaScript onclick() call/method. Attached is the image in which method/function name is highlighted. Now, In this method ...
1
vote
2answers
753 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 ...
0
votes
1answer
72 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
54 views

Is it necessary to write test cases for different test levels?

When creating test cases after unit testing(done by developers) QA team starts working on component testing. For component testing level there will be test cases written by the QA's When it ...
2
votes
1answer
153 views

Should I write unit tests when the json schema is validated by a 3rd party library

I have some json data and I would like to validate the data against a defined json schema. I'm using the ajv library for the validation. On the json schema, there are constraint you can specify like ...
-1
votes
1answer
376 views

Transition from selenium to protractor - worth it?

Over the last few weeks, We have been experimenting with a protractor+typescript+cucumber framework for our new Angular 6 application. The main reason we thought our present Selenium+Cucumber+java ...
0
votes
1answer
416 views

Selenium-Webdriver Edge extension loading issue

I'm creating a base for automated testing of a browser extension, using typescript, selenium-webdriver (https://www.npmjs.com/package/selenium-webdriver latest version) and windows 10. The problem ...
5
votes
2answers
443 views

Automated testing of single page app

I'm working on a single page app and looking into automated testing of the application. The GUI is generated only from JavaScript + css (document.createElement…) All data communication between server ...
1
vote
0answers
21 views

How to print the webservice(jqurey) hit on the console for search functionality

Open a website, press F12 go to network option and enable preserve log now type the work you want to search eg:dogs we can see the service "http://search.test.com/search........." here i want the ...
1
vote
2answers
8k 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
0answers
87 views

How to select item from dropdown element in Javascript

This is the statement i am using in Newrelic synthetic monitor written in javascript return $browser.waitForAndFindElement(By.name("//*[@class=\`attribute-field-container\`]/select//option[5]"), ...

1
2 3 4 5 6