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
votes
1answer
19 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
14 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
30 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
25 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); ...
-1
votes
0answers
17 views

javascript test distributed test framework

Looking for some help and advice here. I am trying to setup spectron for my Acceptance tests. But it will be very slow, so I need to setup a test runner/framework for distributed testing on different ...
-1
votes
0answers
41 views

Selenium Python: JavaScript error: [ITEM] is not defined

I'm new to Python and am having a problem executing JavaScript on a webpage. I am trying to log in to a web interface of a local machine run some setup commands to speed up my work but am having no ...
0
votes
0answers
32 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
27 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
66 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
47 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
67 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
81 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
34 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
0answers
65 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
54 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
37 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
38 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
73 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
118 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
125 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
19 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
116 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
74 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
40 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
39 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 ...
1
vote
2answers
110 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
60 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
82 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
227 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
240 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
66 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
105 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
411 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
160 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
1k 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
462 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
125 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
68 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
32 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
87 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
43 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
51 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://...
2
votes
1answer
2k views

How to use async/await with Protractor-nodejs8

I am completely new to protractor, and I came across the async/await. Is it necessary to use async/await in all your script. And how to use with page object. Using node version 8.9.4 protractor ...
2
votes
2answers
628 views

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

Requirement : link is present inside tabel >td>p>a . i want to Click link the link by TEXT (something like contains(Text)) Tried : by.CssContainsText("a","Text") . did not work, as multiple entry ...
0
votes
2answers
2k views

How to wait for JavaScript scroll action to finish in selenium?

I've come across an interesting problem while automating our web application using selenium webdriver. I'm waiting for page load and all the ajax call to finish but the application use JavaScript ...
2
votes
1answer
341 views

ElementArrayFinder.filter() - how does it work under the hood?

In my UI, I have a project tree that contains a list of components that are in a project. Once my current spec is done running I'm calling a page object function to delete all the components to clean ...
2
votes
1answer
85 views

Unable to get failed status if script is stopped or element is not clickable getting all test pass

I'm Unable to get failed status if the script is stopped or element is not clickable getting all test pass how & what assert should I apply to get this resolved please help me package ...
0
votes
1answer
719 views

How to drag and drop the image using dragAnddrop() in javascript using selenium webdriver?

Without using test framework i have to write this test case to drag and drop to upload the image. please help me if any one know this stuff.If any framework is available also let me know please.
1
vote
2answers
2k 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 ...