Occasional ChromeDriver error when using Cucumber.js --parallel option - selenium-webdriver

I have a UI test framework written in Selenium WebDriver JS, with test scenarios in Cucumber.js. I'm having an occasional issue when running these tests in Chrome and using the experimental --parallel CLI option. I tend to use --parallel 5 to speed up the overall execution time of the tests and this works well in all other browsers than Chrome, where the tests will sometimes end suddenly with the message
Error: EADDRNOTAVAIL connect EADDRNOTAVAIL 127.0.0.1:60730 - Local (0.0.0.0:0)
At that point the browsers remain open but the Cucumber process ends.
I know the --parallel option is experimental but I can find no other mentions of this online so I want to make sure I'm not doing something stupid.
I'm using:
Chrome 73.0.3683.103
ChromeDriver 73.0.0
Cucumber 5.1.0
Selenium WebDriver 4.0.0-alpha.1
(installed from npm).
This is on macOS 10.14.4 if that makes a difference. I can replicate this on other machines with the same OS version too, have not got a Windows machine to hand to try.

I suggest instead of using Selenium WebDriver JS with Cucumber that you use Protractor with Cucumber. Protractor is a JS wrapper of selenium and there is a project that has already done all the hard work of combining cucumber and selenium. Protractor has built-in parallel functionality that was built to run parallel browser testing. Check out https://github.com/protractor-cucumber-framework/protractor-cucumber-framework

This was an issue in selenium-webdriver that is now fixed in master.

Related

How can I configure Selenium to have an extension pre-installed in Chrome?

We have a suite of tests that use Selenium to spawn Chrome instances when run locally. The Chrome instance that gets spawned is a completely vanilla profile with no extensions installed. For debugging purposes it would be useful to have the React & Redux dev tools extensions installed.
Is there a way to configure Selenium to install/enable extensions in the Chrome profile it spawns?
In an ideal world it wouldn't do a full install of the extension every time, but use a locally cached CRX file.
Thanks in advance for any help
#Kiril is right in saying that this question is asked often. You should do a thorough search before posting.
If you are using Javascript+ Selenium do something like this :
chromeOptions = {
'args': ['--test-type',
'--start-maximized',
'use-fake-ui-for-media-stream',],
'extensions': [encode(path.join(__dirname , '/your ext path/yourextention.crx'))],
};

Is it possible to run protractor test with the head on a remote browser?

Can we run the test on our server and display the progress using the users browser ,So our servers have no graphics drivers, we run headless.
Is it possible to run with the head on a remote browser ?
There is PhantomJS but with Protractor is buggy and a dead-end.
You can still use Chrome & Firefox headless through docker-selenium or, if you don't like Docker you can do it yourself with ubuntu-headless sample. Both solutions provide Chrome & Firefox by using Xvfb even though there is no real DISPLAY.
You can also use selenium in the cloud through a paid service like SauceLabs or BrowserStack.
In OSX and without docker you can try http://xquartz.macosforge.org/landing/
In OSX and without docker you can also try Mac OSX selenium headless solution

Bamboo with selenium webdriver

Tools: Java, Selenium WebDriver, Maven, Git, Bamboo
I'm not sure how I can run my test-cases under Bamboo which are written by java and build by maven and stored into Git repository. Bamboo can't open a real browser (IE, Firefox, chrome..)
It's worked when I tried to use HTMLUnitdriver (headless browser) instead of a real browser, BUT the problem with HTMLUnitdriver it is not functioning well (actually, it can't run most of the test scenarios even the other browsers do flawlessly).
I've Google it but could not found any good information on how to do it.
I'll really appreciate any help.
You should not run any test on Bamboo server. CI server is not meant to run any tests on. It should only controls how the tests will be executed instead. There are multiple ways to handle this. Selenium Grid is highly recommended. See another thread here on same topic
Use BrowserStack to execute test scripts and download reports/results as part of build as an artefact.
Or specify an agent that has the browser you need to test on.
https://www.browserstack.com/automate

Appium with Protractor: Working with AngularJS Asynchronous Calls

My Hybrid android app is built with angularjs library with lots of Asynchronous calls all over. How can I integrate Appium with Protractor, so that I can check for complete page loadings including asynchronous calls and other data bindings. My app is developed and ported as APK and not browsed in a browser. Am able to execute my selenium scripts but asynchronous calls is the place where I have stuck.
Please help me.
As of now Protractor doesn't officially support appium configurations. However there is a help file that is available in Protractor docs. All you need to do is update your conf.js file to include the appium configurations and remember to start your appium server before you run the test script.
To your question, you need to have below points ready -
Start your avd
Install the .apk file in your avd that you will be invoking through appium
Start the appium server using command - appium &
Update your protractor conf.js file to include appium android/chrome configurations. More details about configurations can be found in the below link.
Here's the link to it - Protractor-Appium Setup

Running Protractor through a browser on a remote device

We have Selenium running on a test server. We want to run our Protractor tests from a remote device on the same network without having to install anything (e.g. Selenium RemoteWebDriver). We used to do this by running Angular Scenario runner.html, which would execute our e2e tests in the browser via JavaScript.
Does Protractor + Selenium WebDriver allow us to do the same thing?
Nope. WebDriver has to be run through a Driver (chromedriver, iedriver, firefoxdriver), so it can't just be triggered through the browser.
This removes some convenience, but allows for much better native event firing, and means your application doesn't have to serve runner.html somewhere.

Resources