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
19 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 ...
0
votes
0answers
32 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
26 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
0answers
31 views

Verifying that a pdf is correctly displayed

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
votes
1answer
47 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(...
0
votes
1answer
20 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
70 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
30 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
69 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
23 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
78 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
0answers
73 views

Path variable doesn't get the path given in config file and hence don't prepend it

My Config File Looks like this: exports.config = { // // ==================== // Runner Configuration // ==================== // // WebdriverIO allows it to run your tests in ...
0
votes
1answer
92 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
37 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
32 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
123 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
51 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
270 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
vote
1answer
551 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
1answer
43 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 ...
0
votes
1answer
259 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
61 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
47 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
44 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
124 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
258 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
199 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 ...
0
votes
2answers
982 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
83 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
vote
2answers
43 views

How to identify a specific location in returned Json through a postman test

When submitting an order to an API we get a Json response containing: "AMLResults": [ { "amlResult": [ { "addresses": [ { ...
1
vote
1answer
42 views

Postman - flags for different requests on different environments?

I have serviceA, serviceB, serviceC..., up to service L. I have a collection with requests for all those services. Is it possible to set somehow flags for postman runner for requests to be run on ...
2
votes
2answers
153 views

Best practice to TDD a unit of work in frontend JavaScript

Context Right now, I'm working on an overhaul of an edit page for a menu, which is quite involved in and of itself. I have identified the issue: there is literally no structure in place for when a ...
0
votes
1answer
202 views

how do I define global variable in conf.js and used in spec.js file in jasmine protractor?

describe('Enter Base API URL', function() { it('1st scenario', function() { // Take any URL. browser.get('xyz.com'); browser.ignoreSynchronization=true; var user= by.xpath('//...
1
vote
1answer
128 views

Cucumber Protractor tests is returning 0 scenarios

I was trying to run a sample test in cucumber protractor javascript tests. But it is returning 0 scenarios.Could someone please look into my code pasted below. sample_scenario.feature Feature: To ...
1
vote
1answer
326 views

How to structure data driven Protractor/JS tests in page object model?

I am using protractor/js for automating end to end tests for our website. We have a test data set that we have saved in different JS files and we use this data while executing test cases. We are ...
1
vote
2answers
336 views

Maximizing Chrome Window size in Jenkins for Protractor Tests

We are in the process of setting up Jenkins for our testing projects and we are facing a huge challenge for browser window size. The app we are testing is a Progressing app so with the default screen ...
0
votes
2answers
74 views

Trying to get XPath of a dropdown item on webpage in NewRelic monitor

This is the code which I'm validating but its not able to get the Logout option under the dropdown. I copied the XPath value of Logout from the dropdown. This is what the dropdown looks like. This ...
2
votes
2answers
148 views

How to assert checkbox is marked using JavaScript

I’ve problem to assert that checkbox is checked. I’m using automation web testing framework which recording my clicks and generate JavaScript code. The problem is even if the checkbox is unmarked, ...
0
votes
1answer
690 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 ...
0
votes
2answers
220 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 ...
1
vote
1answer
2k views

When I tried to install opencv4nodejs I am getting an error

I am new to appium using javascript and to install appium I am following this link Setting up appium with javascript So when I installed appium-doctor and ran it I got an error. info AppiumDoctor ...
0
votes
1answer
621 views

Error showing “Include a platformName” capability

I recently started to learn Appium with Javascript. When executing my script, I am getting an error stating "Include a platformName". I don't understand why, even though I have included it (...
1
vote
2answers
306 views

'to.include' is not working where 'to.eventually.equal' is working

I was trying to check whether a string is present in another string. I am using the below code: expect(actualTimeZone).to.include(employee.timeZone); But it is giving the below error: ...
2
votes
1answer
72 views

getText() which is in between <div> </div> tag?

Get text which are in between tags DOM <div id="div_ResultMessage" class="AlertmsgDiv"> <div id="lblSuccessMessage" class="alert alert-success alert-dismissable"> <div ...
1
vote
0answers
33 views

Code Coverage using Scala Automation Testing for JS web application

I'm looking if there's an existing application or tool that will run code coverage based on a scala implemented automation suite running against a Javascript web application. Our automation framework ...
0
votes
1answer
41 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....
2
votes
1answer
118 views

how to open a firefox browser through selenium 3.6.0 with another profile using Javascript

I want to launch the Firefox browser through selenium-webdriver 3.6.0 with some of the default settings of the browser changed. Specifically, I want Firefox to download files, during automated testing,...
1
vote
1answer
44 views

How to automate software feature test coverage via tagging?

We are considering map software features against their respective automated test case to assess test coverage. The initial step is manually record all available software features The second step is ...
1
vote
1answer
57 views

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://...