Hot answers tagged

17

I do use Webdriver to use Angular pages. So it IS possible, and OP's assumption is wrong. But it is not easy - not as straightforward as using WebDriver to automate more traditional web pages (which do not use "single page application" concept and DOM manipulation so heavily), where is trivial to add id or name to any element you want. Angular uses IDs ...


6

Open Source: I am a developer at Cypress.io. Cypress recently released its public beta and is now open source. The code for it's core product, the Test Runner can be found here. The Cypress Dashboard Service, used to display test recordings and data when tests are run in CI, will be free for open source projects and paid based on usage for private projects ...


6

Open source: Cypress.IO looks promising, but I have been holding off with starting to use it on a production project. My main reason that it is a commercial company and I cannot be sure they keep their open-source promise. I think development tools should be open-source. I don't want to invest my time and our company's resources if I am not sure I can re-...


5

There's two types of testing in the context of your question: black box testing and white box testing. General issue A black box tester doesn't know anything about the system. This allows the tester to uncover bugs that someone more familiar with the system might overlook. A white box tester has more familiarity with the system. Based on knowledge of the ...


5

As an aside, although I will want to test the 'log in' capability too, is there a way to 'skip' this during testing, so that I can run the tests on all of the features of the app, without Protractor having to log in to the app every time to run the tests? You have multiple ways of handling that, but using beforeAll() to provide setup for your it() tests ...


4

Let's first wrap our heads around the definitions: a lot of different languages have selenium bindings. And JavaScript is no exception - WebDriverJS are javascript selenium bindings - a selenium client written in JavaScript Protractor is a library that is built on top of WebDriverJS adding a lot of convenient and handy functionality on top. And, at the ...


4

Shutting Selenium is useful default for headless testing. I am not familiar with Protractor, but there should be a configuration parameter to keep browser open after run. And why you want browser to hang around after test, especially successful test?


4

When you are specifying seleniumServerJar and seleniumPort you are instructing protractor to take care of controlling a selenium server. Protractor would then start it as a child process before executing your tests and then shut it down after. If you want it to connect to running Selenium server, use seleniumAddress configuration option instead - Protractor ...


4

If you are not sure about the locator then you can use the action class sendKeys method to interact with the field. Here, it interacts with the active (currently focused ) element. So the first step is to bring the element to focus, this can be done by just clicking it: await browser.get('https://stackblitz.com/edit/ngx-monaco-editor-example') await ...


3

I am currently working on an angular app with python/selenium e2e tests. The main difference is that protractor offers not just selection logic (model, binding, etc.) but also implicitly waits for angular page load, url changes, model updates. To make up for these missing pieces. We had to have a fair amount of explicit waits. I have not used it personally,...


3

I have worked with a couple of JavaScript front-end frameworks (Angular, Ember and React) an all of them have their own tools to write (whitebox) tests. The (included) test frameworks let you render the components in isolation letting you verify their behaviour without the need of a browser. Letting you write unit like tests, but also integration tests. ...


3

Agreeing on good element and attribute identifiers is essential with web applications. Identifying elements is done by developers, designers and automation programmers. In a traditional waterfall environment with most of the requirements and specifications placed up front you can agree that, for example all elements that will be used, checked, clicked on ...


3

Which is better, a hammer or a screwdriver? One may always use hammer on a nail but if you are working on screw then it is better to use screwdriver if you have one(Protractor!). I have used both selenium & Protractor to test angular sites and from last couple of years using Protractor extensively to design large scale test automation for Angular/...


3

With the default config suggested in the tutorial, Protractor expects a selenium server at the 127.0.0.1:4444 address. And, I suspect, you have not started a selenium server. So, one way to approach it would be to use webdriver-manager package to start a local selenium server as suggested in the Setup section of the tutorial: webdriver-manager start And ...


3

HTML id is not the same as HTML name. It's common to have fields where the name and the id are different: <input id="user_name" name="inputName"> If you change your code to find the fields to element(by.name('inputName')); and element(by.name('inputPass')); it should find them. The way you handle common routines like logging on is to use something ...


3

Generally speaking, you are doing end-to-end testing with Protractor. End-to-end testing with Protractor/Selenium typically tries to simulate the user actions and behaviors in the browser, staying on a high implementation-agnostic level. In other words, I personally think you should try to find a way to close the dialog without calling the function that is ...


3

Angular has some great tooling for running tests, namely Karma and Protractor. By default (at least when using Angular CLI) they run using Chrome. So when you execute the tests from command-line, it will pop open a browser window where the tests execute. This works well enough, but sometimes you either don’t want to see that browser window pop open or you ...


3

You just ask karma to run Chrome headless. It's no longer necessary to create it out of ChromeOptions Here are the first few lines from my karma.conf.js module.exports = function (config) { config.set({ browsers: ['ChromeHeadless'], // Chrome ChromeHeadless .... You get this with the karma-chrome-launcher, which it sounds like you ...


3

The tutorials on Protractor's site is pretty self-explanatory and assumes no webdriver experience. So there's no need to try to start with Selenium/WebdriverJs first. Another great thing with Protractor is the ability to co-locate your test code along with the app's development code and have them run at build time. If the app was built with angular cli, it ...


3

browser.waitForAngularEnabled(false); needs to be explicitly set in the spec/config files.


3

It is difficult to suggest things without being able to test or check them, but, according to the information we have and taking into account that there could be multiple rhr-radio-button elements on a page, I'd combine the tag name check and the element-id check: $('rhr-radio-button[element-id=tenderValidType]').click(); Note that element-id attribute ...


3

With Selenium you can interact with web-browsers to drive web-applications. Angular7 result into web-applications, so yes it should be able to handle it. But, Angular has its own layer on top of Selenium to make testing Angular applications easier: https://www.protractortest.org/ Other reads: https://medium.com/@dhormale/automate-end-to-end-e2e-testing-...


2

Selenium WebDriver is a tool/library that enables automation, whereas Protractor is a Test Runner/Test Framework which defines the design/structure of the automation. If your tests are flaky, it might need deeper analysis to determine the cause of flakiness. I've been automating AngularJS applications using SerenityBDD and Selenium WebDriver for almost over ...


2

You can just use plain Selenium for testing Angular applications. Protractor just makes it easier to test Angular application. Its a framework for testing Angular applications. It has Automatic Waiting for elements and you can access specific Angular elements by.model and by.binding. Also it implements the Page Objects in the framework making tests more ...


2

It seems to be best practice to make the automated tests at the gui level in the same language as the program under test is written in. Or at any level actually, it also applies at the api, business logic, data store and what ever other layers have been made across the stack. It just helps in having a shared responsibility. No dev would like their build ...


2

There is no theoretical difference between the two options. In Protractor/WebDriverJS, there is always that active Control Flow mechanism which is a dynamic queue of promises that handles the ordering of the promises and their resolutions. In other words, there is no need to explicitly resolve promises of click() actions as in your first option.


2

This turned out to be a problem with the Browsersync settings in webpack config, not with browser instances. Setting ghostMode:false in the Browsersync settings section of the webpack config solved the problem


2

To add to the other answers here, the one time when it helps to know 'the technology behind the system under test' is when you're using recording tools to record automation tests. For instance, I once attempted to use Ranorex on an old .NET WinForms application, which Ranorex handled badly. It just could not identify any elements, relying entirely on the ...


2

Seemingly it does not help with Blackbox testing, but for other types of testing it could help a lot. Think of security-testing, load-testing and test-automation. Knowing the technology stack could help or impact with testing things like: Known defects in the stack, with info from the suppliers. Common mistakes that can be made with the frameworks might ...


2

1) If you're testing at the level of an http request your app's use of angular is almost certainly a non-factor. Angular would matter more were you testing at the browser level ("as a user" basically). When talking about http request level testing you're thinking more "as a system" and how it interacts with your api. 2) What're you're looking for is an ...


Only top voted, non community-wiki answers of a minimum length are eligible