Knowing basics of JS will let you:
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 ...
To answer your questions:
Here is a script which loads jQuery through WebDriver. I've been using it successfully for quite some time.
-- will not overwrite any existing jQuery instance.
-- will not alter the DOM under test or pollute the global namespace
-- cleans up after itself to avoid memory leaks
-- waits for jQuery to be fully loaded before returning.
-- takes an ...
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 ...
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 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 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 ...
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 ...
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. ...
var scriptElt = document.createElement('script');
scriptElt.src = jsFile;
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");
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, ...
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 ...
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 ...
I would not suggest doing so until you have a specific objective to be met by doing it.
In my opinion, its only worth the effort if you are working on large development project but for comparatively smaller UI automation projects with less than 1K tests, I would not suggest so.
Also, there are a lot of misconceptions about the advantages of moving ...
TL;DR: convenience of programmers not the only deciding factor when selecting the implementation language.
Promises are necessary when programming page events and response to asynchronous AJAX calls.
But for browser automation testing (which is supposed to mimic user's interaction with a page), they are not necessary at all. User usually initiates an ...
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 ...
I would expect directly referencing it by a few milliseconds.
However premature optimization ('efficiency, performance') without a clear issue to address will 'fix' the wrong problem and lead to less readable and maintainable code, which is more important.
So 'faster today' will quickly lead to 'but slower 'tomorrow' (i.e. the next time a change is needed) ...