Hot answers tagged

8

WebDriverIO / Protractor How about using WebDriverIO or using Protractor since they both are the JS like-version of Selenium, using Cucumber for the BDD syntax. We have a SPA, built using Angular4 , and we run almost 200 e2e scenarios, having vanilla JS code in Protractor, using the various waits and it works pretty good actually. WebDriverIO: http://...


6

Headless Chrome is not stable yet in comparison to "full" Chrome. In my opinion there will always be problems with headless vs phantomjs (and others) vs full versions. And so there will always be place for phantomjs (and others) in the world of automated testing. Consider your choice wisely. Few possible limitations of Headless Chrome: Headless mode is ...


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


3

As it is stated on jQuery site A page can't be manipulated safely until the document is "ready." jQuery detects this state of readiness for you. Code included inside $( document ).ready() will only run once the page Document Object Model (DOM) is ready for JavaScript code to execute. Code included inside $( window ).on( "load", function() { ... }) will ...


3

Use Docker-compose to run Protractor tests in parallel I would suggest to make tests purely independent and run them in parallel in dockerised containers using Selenium Grid to achieve the desired speed with stability. With docker-compose, this solution is scalable with given hardware capabilities. https://stackoverflow.com/questions/36773167/how-do-you-...


3

I am using headless chrome in version 65 in protractor test execution and I find it pretty stable for a suite of 500+ tests and even for the failed tests screenshots captured are of decent quality and useful.


3

You are assigning datefinal to the result of the console.log() call - which is undefined, hence the error. You meant to assert against dateString string: expect(cells.get(6).getText()).toContain(dateString);


3

If you build your tests so that each test can run in isolation. Then you can scale your testruns by running them in parallel. Testing in isolation maybe a bit slower for the individual tests, but it is the only way to scale a larger test suite. Also I would research which tests to can be removed or moved down the ladder of the test-pyramid. Most single slow ...


2

nightwatch.js module.exports = { 'Demo test Google' : function (client) { client .url('http://www.google.com') .waitForElementVisible('body', 1000) .assert.title('Google') .assert.visible('input[type=text]') } }; One option is nightwatch.js One example is to have a single page object file in Nightwatch for each entire site. ...


2

Choosing the best, most reliable and readable locator is not always straightforward. Here, I would rely on the nav-* classes and use the by.cssContainingText strategy: var sellingBranches = element(by.cssContainingText(".nav-item a.nav-link > span", "Selling Branches")); sellingBranches.click(); var byBranch = element(by.cssContainingText(".nav-item a....


2

You are definitely missing some test case grouping and a beforeEach() where you would navigate to an initial "Log In" page. You should have something along these lines: describe('Login', function () { var GM; beforeEach(function () { GM = protractor.ExpectedConditions;; browser.get("http://folio3.github.io/eCareVault/#"); }); ...


2

PhantomJS notoriously has a lot of memory issues and will crash after a certain amount of memory use. I have dealt with this issue by splitting up the tests into separate phantom processes rather than all in one.


2

Since your span elements don't have a text, you can basically "ignore" them. In other words, get the parent div element and get the text via getText(): expect($(".engage-tag").getText()).toEqual("SampleList23.csv");


2

The most important thing in this traceback is actually this part: The following tasks were pending: - $timeout: function () { clearEvents(type); } - $timeout: function setErrorMsg() { // Broadcast system timeout lock event $rootScope.$broadcast('um:LCK_TIMEOUT'); That $timeout is an Angular service which Protractor waits for to complete and does not ...


2

In true javascript style , the support for this is delayed because of switch to another underlying library , in this case jasmine. There is a -t option here (or --testNamePattern ) which takes a regex that matches on the text. If you ran jest -t dashboard you might have more luck. https://facebook.github.io/jest/docs/en/cli.html#testnamepattern-regex


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


2

You may just use expect() and toEqual() matcher: browser.get('https://angular.io'); expect(element.all(by.css('.nav-link')).getText()).toEqual([ '', 'FEATURES', 'DOCS', 'RESOURCES', 'EVENTS', 'BLOG' ]);


2

Keasav, I understood your problem after your reply, and what's causing that behavior is the (very) old version of the geckodriver that you are using and the Firefox version as well. 1 - So the latest geckodriver version is 0.19.1 (and yours is 0.10.0, but many changes have been included since that build was released), and the latest Firefox is now at 57 (...


2

On Jasmine 3.x, random order is the default behavior. To run in order file written order, you can specify --random=false or use a seed. Docs: https://jasmine.github.io/api/3.3/Configuration.html


2

Okay I got solution for this: var str = $('#lblSuccessMessage').getText().then(function(text){ console.log(text); var r = /\d+/; console.log((text.match(r)[0])); prno = text.match(r)[0]; //prno = str.match(/ Pur. Requisition No. Acc(\d+)/i)[0]; }); //console.log("Purchase requistion no..."+prno);


2

You can't. What you can do is write a loop, that checks: Is the user on the page? No, then click on next page Yes, quit loop and record user element Throw error if after last page the user is not found This might be very slow, but end2end tests can only do what users can, they cannot do magic. Unless you ask the developers to build in the magic. For ...


2

You may group tests as suites like below: Conf.js suites: { smoke: 'tests/e2e/smoke/*.js', performance: 'tests/e2e/performance/*.js', regression: 'tests/e2e/regression/*.js' }, And run like below: $ protractor conf.js --suite smoke Using jasmine framework, tests can also be organized/grouped using a regular expression. You can ...


1

As it is written in your log sample Chrome version must be >= 68.0.3440.0 So you have to update you Chrome browser to meet version requirements. P.S. - or downgrade your webdriver version.


1

Where to use async-await in Protractor scripts? Async/await statements are only required in places where promise resolution is occurring before moving to the next statement so yes, it is only required for asynchronous promise returning statements. Why use async-await in Protractor scripts? WebDriverJS (and thus, Protractor) APIs are entirely asynchronous. ...


1

Issue fixed. My bad... was thinking more complicated than it's. It's even not something protractor specific. just native JavaScript Solution: var getHref = email['html'].match(/href="([^"]*)/)[1];


1

Issue fixed. I think this posting here is really too old and just doesn't work as it should be. First of all here is the one which would run without issues, and you also find the comments which explain what each function does etc. Code in protractor.config.js added in onPrepare() method looks as following: var MailListener = require("mail-listener2"); ...


1

After additional time and working with yet another Windows 10 machine I have successfully gotten this simple test to run. I can only conclude that there was something on that particular machine preventing the proper execution of the test. I wasn't able to figure out what that was, but, the "does it work?" question is answered. It does (which is what one ...


1

How I've done this with protractor in the past is like... single suite protractor config.js --suite A multiple suites protractor config.js --suite A,B,C Note: commas but no spaces between suite names I'm personally not sure that --suites is valid in protractor CLI


1

First all, how should awnser if the tab is clickable or not? The tab itself. So, in the tab page object, you should have a function like this: function isClickable() { return this.getAttribute('class').contains('disable'); } With this, in your test, you can get each tab and test it: expect(tabA.isClickable().toBe(True)); ... expect(tabE.isClickable()....


1

As far as I understand this sort of parallel test running, I believe "shardTestFiles" will run test files in parallel but if a test file has multiple test cases those will run sequentially on a single browser instance. With your single spec file I would not expect parallel execution when running your config. However, were you to split them up into 4 test ...


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