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
32
votes
10answers
14k 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 ...
15
votes
3answers
9k views

What are some tools for fuzz testing?

Fuzz Testing as defined by Wikipedia is: a software testing technique, often automated or semi-automated, that involves providing invalid, unexpected, or random data to the inputs of a computer ...
10
votes
3answers
12k views

Why should we use javascript for UI test automation?

Background:JavaScript based automation frameworks heavily depends on asynchronous execution, promises, callbacks, anonymous functions, etc which are inherently complex and probably an overkill for a ...
10
votes
2answers
584 views

Detecting complicated CSS selectors

This is a follow-up to What makes a good selenium locator? Motivation I've been thinking about detecting the complexity of CSS selectors statically. The scope I'm working in is both test-automation ...
9
votes
5answers
30k views

WebDriver: Can I inject a jQuery script for a page that isn't using jQuery?

Is it possible to inject a jQuery script into a page if the page isn't already using jQuery? We have a few pages in our sites where we don't add jQuery if it doesn't need it, but I'm using it to ...
8
votes
3answers
855 views

End-to-end tests are running for 5 hours

This is a continuation of Speeding up end-to-end tests topic, but a more specific one. Currently, it takes ~5 hours for our daily end-to-end testing run to complete. What can we do to improve on ...
8
votes
2answers
866 views

Canonical way for multi-session browser testing in Protractor

The Question: What is the canonical way to write multi browser window tests in Protractor - the tests that involve multiple sessions fired up interacting with one another? The Story: The main ...
7
votes
3answers
11k views

Handling self-refreshing pages from selenium

I have been running into intermittent errors with some java selenium-rc tests which I think are related to a page which has an ajax poll and automatically refreshes when some condition is reached on ...
7
votes
4answers
1k views

Headless Functional Testing For Your JavaScript Web App?

JavaScript is everywhere right now. With the advent of jQuery and other associated JavaScript frameworks it's amazingly simple to add very powerful user interactions to web sites and web applications. ...
7
votes
3answers
599 views

Behaviour Driven Development with JavaScript

Are there any approaches and tools for driving the development of JavaScript with BDD. I know that I can do this through the UI with tools like Selenium, but is there any tool that can allow this to ...
7
votes
1answer
4k views

What Is the Best Way To Mock Browser Time and Time Zone in Selenium? [closed]

I like to run Webdriver tests with altered time and time zone. I see two approaches ahead: 1) Using a mocking library like SinonJS or TimeShift.js. 2) Using system libraries like libfaketime/...
6
votes
7answers
7k views

I want to learn Selenium but not sure about the language I need to learn for automation

Java or Javascript? or maybe another language? Please help me choose the programming language I should learn for Selenium automation and its benefit over other. Any pro's and con's?
6
votes
2answers
1k views

Switching from JavaScript to TypeScript for Protractor e2e tests

Not very long time ago, Protractor itself migrated to TypeScript internally. I've also heard and seen several Protractor test projects moving to TypeScript. We have a rather big and growing test ...
6
votes
2answers
990 views

Include assertions/expectations within the Page Objects, yes or no?

Martin Fowler favors having no assertions in page objects however is not definitive on the subject: Advocates of including assertions in page objects say that this helps avoid duplication of ...
6
votes
1answer
2k views

Inconsistent results when capturing javascript errors with WebDriver

I'm using a technique I found here, to capture javascript errors for testing purposes. It's a technique that is frequently recommended on Stack Overflow for those who need to catch JavaScript errors ...
6
votes
1answer
143 views

Test Quarantine in Protractor

Follow-up to How to deal with flaky tests? One of the approaches to tackle flaky tests is to temporarily quarantine the tests - move them to a special "bucket" with other flaky tests: I offer one ...
5
votes
5answers
62k views

Not able to scroll down page using Selenium webdriver [duplicate]

I want to scroll down a page that is coming inside a form, not on the main page. I tried this code: JavascriptExecutor jse = (JavascriptExecutor)driver; jse.executeScript("window.scrollBy(0,250)", "...
5
votes
2answers
2k views

Speeding up end-to-end tests

When we execute the same set of end-to-end browser-automated tests on BrowserStack, we notice a dramatic slowdown - tests are much slower than if executed locally and there are occasional failures ...
5
votes
2answers
243 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 ...
5
votes
1answer
80 views

What is quality javascript in the new world of es6+

Javascript has changed hugely in the last five years with es6 Now we have choices about whether to use let, const or var We can choose whether to use arrow functions to reduce code verbiage Is ...
5
votes
1answer
59 views

How to unit test the plethora of js frameworks?

There's a bunch of popular javascript frameworks such as Angular React Vue Ember Meteor What tools exist for unit (white box) testing each of them? Does each framework support its own unit testing ...
5
votes
2answers
796 views

Using SuperTest/Protractor on unsecure HTTPS

I am trying to run automated API tests on localhost with an invalid cert. Is there a chromeOption equivalent to "Proceed Anyway" that I can pass to the tests so they can get a response from the url? ...
5
votes
2answers
144 views

Is there some published JavaScript with a list of 'interesting' test strings?

I went looking on the Google for a simple JavaScript object or other bit of JS code that can deliver a list of strings that are interesting for testing. I thought there would be a billion hits, but I ...
5
votes
2answers
4k 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. ...
4
votes
2answers
290 views

How to utilize javascript asynchronicity to speed up test execution?

How to utilize javascript asynchronicity to speed up test execution in protractor tests other than running tests in parallel? **Note:**This question is about utilizing core features of JavaScript ...
4
votes
2answers
302 views

Does WebDriverJS/WebDriverIO promises make javascript the language of choice for Selenium?

I don't believe any other Selenium-compatible language supports promises which seems like a game-changer when it comes to dealing with waits. Since no other Selenium-compatible language supports this,...
4
votes
3answers
314 views

How to profile end-to-end tests to find the slow ones?

The Story We have a big end-to-end test codebase written in Protractor/WebDriverJS. We are using jasmine-spec-reporter for the command-line test reports. It reports test execution time for every ...
4
votes
1answer
211 views

Given When Then - is one 'then' per test acceptable usage?

I don't know if this has a sort review process, but here goes (direct me elsewhere if appropriate) I have written these tests, and wondered if my use of Given, When and Then was correct. I ask ...
4
votes
3answers
2k views

Tools for automated testing of web site in JavaFX WebView

Automated testing of web site in JavaFX WebView I have a Web Site, for which I have to write automated tests. The WebSite is built with the following technologies: HTML, CSS, Js, AngularJS. The major ...
4
votes
4answers
324 views

What tools are recommended for end to end page load time testing (including ajax and styling elements)?

We are looking to measure the length of time it takes for certain key pathways to become 'usable' e.g. certain styling elements will have loaded in and some information ajaxed in on a page. Ideally ...
4
votes
2answers
3k views

iOS UIAutomation UIAElement.isVisible() throwing stale response?

I'm trying to use isVisible() within a loop to create a waitForElement type of a function for my iOS UIAutomation. When I try to use the following code, it fails while waiting for an element when a ...
4
votes
1answer
244 views

What to use for user acceptance testing for a single page application?

The app uses a javascript framework to update the single page. Ajax is used for data updates How I can automate user acceptance testing for it? Usually I use selenium through through the capybara ...
3
votes
7answers
5k views

Which automation tool needs JavaScript or JQuery to be used more?

I have started off my career in manual testing and an automation tool rarely. I would like to concentrate more on automation testing. I believe I have the object-oriented concepts in a good manner. I ...
3
votes
3answers
4k views

Can we generate unique distinct users for parallel tests in selenium?

Can we generate unique distinct users for parallel tests in selenium WebDriver and java? Suppose, in google create an account action I want to pass firstname, Lastname, Username & Password for ...
3
votes
3answers
4k views

Correct CSS selector for selenium

Which css selector's correct for the following HTML code ? <li class="active editing" data-index="0"> <div class="view"> <input class="edit"/> </li> I'm trying to get ...
3
votes
5answers
550 views

Lightweight load & performance testing frameworks

Which lightweight load and/or performance testing frameworks could you recommend? some considerations: Configuration with not too much coding (some JS would be okay) command line + text editor (...
3
votes
1answer
3k views

Is there a way to disable a JavaScript function of the tested application from Selenium WebDriver automation project?

I need to disable a particular JavaScript function of the main application for which I am creating automated tests using Selenium WebDriver. Is there a way to do this?
3
votes
2answers
624 views

Should I use Jasmine/FrisbyJS or Mocha/Chai for testing of live API with Angular?

What I'm looking for in an answer Concrete relevant(newer?) examples of why one choice is better than the other OR, a concrete suggestion of why using a different language is the better choice over ...
3
votes
3answers
10k views

How to handle windows authentication pop up with Protractor?

Use case: When URL loads, it request for Windows authentication (Enter Username and Password). How it goes is: loads the url on clicking Post button in the page. Windows Authentication pops up ...
3
votes
1answer
9k views

How to get selected option text from a select box selenium node js

How to get the selected option's text using selenium webdriver node.js. In java we can use getFirstSelectedOption but it is not working in node.js. How it is possible? Here is my sample code. driver....
3
votes
2answers
6k views

Switching windows with non angular pages using Webdriver JS

I have a non angular page that I open and then click a link, which changes pages and I fill out a form with some information and then click a button. Upon clicking that button another browser window ...
3
votes
1answer
85 views

Looking for a graphic tool to visually present testing coverage

I have been reviewing existing test cases. There is no easy way to visualise current testing coverage; the only way testing coverage can be assessed is reading through the test case repository, e.g. ...
3
votes
1answer
417 views

Using Functional programming for UI Test automation

From what I have read about functional programming, it is considered to be more concise, more testable, and have fewer side effects. Would it be good to use for UI test automation? Context: I am ...
3
votes
1answer
549 views

WebDriver Error Cannot use 'in' operator to search for 'String' in false

I have been using selenium webdriver with protractor for more than a year now and recently after updating to the newest versions i got an error that i have never encountered before. As stated in the ...
3
votes
2answers
3k views

WebdriverJS ElementNotVisibleError: element not visible

I'm new to Selenium and I think I'm just not understanding what is happening in the code and browser. I can work around my issue by replacing the driver.wait code (posted below) with a driver.sleep(...
3
votes
2answers
82 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 ...
3
votes
1answer
2k views

PhantomJS not rendering all of page even with a few seconds delay

I am using my linux box to try and periodically download my local skateboard park's webpage and search for whether there are free skate-school lessons available. I'm currently falling at the first ...
3
votes
2answers
5k 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 ...
3
votes
1answer
473 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 ...
3
votes
2answers
104 views

how can i modify html report so that i can print passed and failed test case name in html report in jasmine framework?

i want to print custom message with passed passed, Thanks in advance