22

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 ...


14

Adding couple notes to Niels's great answer. Protractor wraps WebDriverJS which is Javascript Selenium bindings - in other words, Protractor does interact with a browser through the Selenium WebDriver. Protractor provides a really convenient API and has some unique Angular-specific features, like Angular specific element locating strategies (by.model(), by....


13

Protractor is Selenium, but then integrated with tooling and helper methods. If you know programming and Selenium it should be relative easy to pick up. Protractor is an end-to-end test framework for Angular and AngularJS applications. Protractor is a Node.js program built on top of WebDriverJS. Protractor runs tests against your application running ...


9

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: Solution: Install system-sleep module: npm install system-sleep ...


8

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 headless natively) 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 ...


8

I followed the below transition process myself successfully: Learned basic JavaScript, including basic constructs like variables, loops, conditions, functions. Learned advanced JavaScript, particularly asynchronous nature, and its problems. Usage of callbacks and role of anonymous functions. Once I grasped the basic concept of async execution, learned what ...


8

It's an okay idea with some guidelines. QA code is software. And software engineering principles should still apply. Since none of the developers know protractor, they should be trained. They may be able to add tests to their application on their own eventually. As for who to code review, the frontend developers are probably a good choice. They might ...


7

I think you've got it wrong. Organizing test specs into suites in Protractor does not mean you need to copy the file and keep multiple versions of the same file. Instead, suites is simply a configuration parameter that maps "suite names" into a list of specs. In other way, this is a way to group specs by a certain criteria. Example: suites: { smoke: [ ...


7

Avoid the use of 'Absolute XPath' if possible in your coding. If your element is having with class, ID, name & Type attributes then try to locate the element with the use of Relative XPath. You can use- XPath: //input[@id='portfolioName'] OR XPath: //input[@id='portfolioName'][@type='text'] OR Xpath=//input[@type='text' AND @name='portfolioName[]'...


6

Hammer vs. Screwdriver Yes, it is possible but highly inefficient with full of hard coded waits! Which is better, a hammer or a screwdriver on a screw? One may always use a hammer on a nail but if you are working on a screw then it is better to use a screwdriver if you have one(Protractor!). I have used both selenium & Protractor to test angular sites ...


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-...


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 ...


5

Yes - For Unit Testing Javascript 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 ...


5

The nice thing of TypeScript you do not have to migrate at once. TypeScript is a superset and can parse plain JavaScript as well. You can keep your old code and start using TypeScript for new code or just some features. Read this story about gradually switching at Slack: One of the reasons why the Slack team chose TypeScript is its being a superset of ...


5

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. ...


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 ...


5

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 ...


5

Goto EDGE > setting and scroll down: Here note the edge html version , that is the version for which we have to download the driver for. The below command (for downloading webdriver for edge html version 18) , ref: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ DISM.exe /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~...


4

If it is an Angular application I would go for Protractor EDIT: Protractor was made for Angular Apps. You don't have deal with elements not being visible yet due to page loads. Protractors deals with it for you As far as I know CodedUI des not provide this functionality. Correct me if I'm wrong. Resource reason: Most Angular projects are javascript ...


4

The trade-off is between script length and diagnostic value: Script length: one script with everything in it may be shorter (and should never be longer) than a positive script plus a negative script, because multiple scripts will duplicate setup steps. Because it has fewer steps, the everything script will probably be faster to execute than multiple ...


4

In my opinion you should not mix positive and negative paths because every test has to be independent and give a clear result. Suppose that you create 100 scripts both positive and negative and all tests with negative paths fail, in theory you'll never know if they would fail even with positive ones until you fix your code. My suggestion is having a ...


4

You just need to remove all files in the "Downloads" directory inside the onPrepare() function which you define inside your Protractor configuration file. Let's use the synchronous rmDir function suggested here (feel free to use a different method): var fs = require('fs'); function rmDir (dirPath) { try { var files = fs.readdirSync(dirPath); } catch(e)...


4

We have recently started with writing WebDriver tests in JavaScript and I have to agree that the asynchronous execution is adding an unneeded complexity. Pro's: Same test-runner as other (front-end) unit-tests Everyone knows JavaScript (e.g. front-end development with Angular, Vue or React) If you use JavaScript (e.g. NodeJS) also on the back-end, sticking ...


4

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 ...


4

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 ...


4

NO. 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 ...


4

An absolute XPath should start with a slash /: '/html/body/div[2]/div[1]/div/div[1]'. It is advised to use relative XPath like: '//div[@id="portfolioName"]'. For this to work, the id has to be unique for div tags. However if the id is unique, you can better identify the object by id and not XPath: driver.findElement(By.id("portfolioName"))


4

Say "No" to XPaths, to quote the Protractor style guide: It's the slowest and most brittle locator strategy of all Markup is very easily subject to change and therefore xpath locators require a lot of maintenance xpath expressions are unreadable and very hard to debug There are better, faster and more readable ways to locate the ...


4

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 ...


4

After a long hard fought battle, I was able to overcome this using opposite of what K-8 had suggested. Instead of checking if an element is visible on the viewport, I checked the negative of that, which is if element is not visible on the viewport. So, I did this public waitForSpinnerDisappear(){ let EC = protractor.ExpectedConditions; browser.wait(EC....


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