Knowing basics of JS will let you:
To answer your questions:
One of the reasons would be to write end-to-end automated tests using Protractor.
Additionally, knowledge of a programming language used in a project may be ...
See, you can learn Selenium with any language, whether it is C#, Java, Ruby, Python etc. It doesn't matter whether the application you are going to test has been developed in the same language that you would use to write your test scripts, you can test an application developed using C# in Selenium with test scripts written in Java.
In addition to that, you ...
Hi i found another csv module : csv-parse : https://csv.js.org/parse/ (Its used in postman)
const parse = require('csv-parse/lib/sync');
Use this module for data-driven testing instead of below-step
Below method is deprecated:
Made it work.
Please suggest any better ways if anyone knows:
Install system-sleep module:
npm install system-sleep
Depending on how those microservices interact with each other there may be several possibilities. The whole microservices concept was created to allow microservices to be developed/tested/deployed independently.
That means, in an ideal world, microservices would interact using some kind of contract and API. Usually (almost as de-facto standard), ...
I discovered the following points while speeding up my protractor(selenium) tests:
Run tests in a headless browser(from version 59, chrome can be run
Run tests as direct connection(directConnect: true)
Don't log off & reuse user session between tests with the same base state(Home Page) wherever possible.
Make short & simple to ...
I am assuming that you:
want to become competent programmer, with goal to learn programming beyond Selenium automation.
have nobody around to ask for guidance (if you do, ask locally)
also want to be able to write simple tools supporting QA tasks, and beyond.
Python is widely considered as best language for beginners (MIT among others). It works much ...
There are much better ways to locate the element aside from using XPath, don't focus on XPath too much - this is, generally speaking, the slowest and the least readable way to locate elements.
I would locate the element by the link text instead, example in Protractor/WebDriverJS:
Example in Java:
I think the basic question should be "Why a software QA engineer should learn programming".
Which programming language to learn is not important, it can always change. As a QA Engineer, you can work on projects from several platforms (web frontend, web backend, mobile, desktop, IoT devices etc).
A QA Engineer could be required to:
perform only manual ...
I recommend you try TestCafe.
It is a web testing framework, using which you can run tests on remote computers and mobile devices, in multiple browsers and on multiple machines simultaneously.
It also eliminates out of process browser plug-ins and provides wrapper-free access to DOM via jQuery or a browser's API. The built-in traffic analysis tool ...
You need to tell it to return the value.
Change this line:
String mainURL = (String) js.executeScript("productObj.mainURL");
String mainURL = (String) js.executeScript("return productObj.mainURL");
I've been working with this concept over the last few years and I've come to the following, multi-tier approach:
Unit testing on the backend. For example with Ruby or Java on the server code.
User acceptance testing on the UI using Selenium and a programming language such as Ruby with Capybara
Unit testing on the front end ...
What parameters would you consider to determine if a CSS selector is resistant to a change? What makes a reliable CSS locator? Some factors I would consider:
To start with, the basics are:
Locator should not include page layout structure
Don't base selector on the actual page text
Work within your existing framework(s)
Prefer css over xpath for ...
One of the reasons why the Slack team chose TypeScript is its being a
superset of ...
A few things to consider come to mind:
Only run in Chrome
Controversial huh? Let me explain more fully though. My question for multi-browser and indeed multi-device (responsive web sites) testing is always what kind of browser / device specific issues have we seen and do we expect to see? How many browser specific errors have occurred in the last year. ...
With the popularity of JS Frameworks like Angular, React, Nodejs, there has been a surge in the testing frameworks using JS- be it an E2E framework like Protractor, Nightwatch, Cypress or API testing frameworks like Chakram etc.
I agree with Peter's answer and I think it puts a lot of valid points.
A frequent argument for the surge of these JS frameworks ...
Given that there is disagreement, the answers this question attracts will probably gravitate toward sometimes rather than yes/no.
My opinion is that page objects should have assertions in their constructors, so that my code doesn't offer page methods for a page I never reached.
In a made up example, I don't want to return an account page object when I've ...
There are two sides of your question which I am interpreting (and may be I am wrong), but this is how I see it :
You can choose your language based on the ease of learning.
You can choose your language based on the support for that particular implementation.
Let's talk about first- I have used both Python and Java implementations and I agree with Peter, ...
If your edit class is unique on the page, then you can do .edit If you need to be a bit more specific, you could do more along the lines of .active.editing input.edit
The point is, theres no "right" answer here, there are often many different css selectors you can build that can point to the same element. You want to find the balance between being short, ...
Your test is supposed to reproduce the user behavior as close as possible, but you are calling the method attached to the button rather than clicking the button. So it kind of defeats the purpose of the test.
What are the differences ?
The Click will ensure that the button is visible and intractable. Calling the method will not.
The Click will emit all the ...
Same test-runner as other (front-end) unit-tests
As you mention, the asynchronous chaining API seen in "selenium-webdriver" NPM package and also in nightwatch, protractor, testcafe, cypress, intern and wd.js etc can be quite hard to understand.
Luckily there is a way to write E2E tests in Node and still get an API that feels intuitive and synchronous, namely http://webdriver.io
Webdriver.io is able to do ...
ScrollBars are operating system elements and cannot be driven by Selenium or WebDriver like other elements.
Possible ways to scroll with Selenium are:
Scroll with ...
We recently switched from mocha to jest and in the process came across a flake which appears to due to a bug in react. Given the difficulty we had in investigating this issue and that it should be fixed in react 16, we too decided to take the approach of simply retrying the failing tests (the flake rate was ~3% and only when running multiple workers, so the ...
From your test framework or from logs, first identify the slow ones.
Debug each test (single stepping) to determine which area is slowest. Identify if it's client or host related, backend, frontend, or just exactly which step chews up the most time.
Look for any exceptions during the test run and address properly.
If you need to do this, run a ...