I am using Protractor to test my angular.js app and its working great in Chrome. I had some issues getting it set up and learning the extra webdriver syntax for jasmine, but now I'm getting the hang of it and have a number of tests that are running and passing in Chrome.
Does anyone know of any way to run Protractor in Firefox or Safari or IE or Opera? I'd like to be able to run these tests against more browsers than just Chrome. I've looked through the Protractor docs on GitHub but it only shows config files for the chromeDriver. Is there such thing as a Firefox driver or a Safari driver?
PS. I don't think it'll be much help, so I'm not posting my current config file, but if it is useful, let me know and I can post it here.
Yes! You'll need to do a little setup depending on which browser driver you want to use, but firefox and safari should be trivial. Their drivers are included in the Selenium Standalone server. Just add
capabilities: {
'browserName': 'firefox' // or 'safari'
},
to the config file.
For IE, you need to install a separate binary, and the Selenium Standalone Server needs that binary to be in your PATH. After that, you should be able to use ie as a browsername in your config. Check out the IEDriver documentation here - http://code.google.com/p/selenium/wiki/InternetExplorerDriver
Related
I have an automation test suite which includes the browser extension loading. I want to run these tests in gitlab but as far as I read, the headless chrome does not support the chrome extensions.
I can't use mozilla firefox as the extension is not supported by firefox. Please suggest me a way so that I can run my tests with the extension in gitlab CI.
Thanks in advance!
While looking for the solutions, I read about xvfb virtual display. I don't know what is it or will it work in gitlab. I tried but it did not work.
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.
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'))],
};
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
I;m just starting to test my app with Selenium and I have downloaded Selenium-IDE and wrote a few test cases. They run nice in Firefox and all pass. I also need to test my app in Chrome and IE. Is it possible to connect the IDE to the Chrome web driver so I can run them there as well?
You can export the scripts as Wedbriver scripts and run it against other browser.
Now you can,
from How to run tests from Selenium IDE in Chrome :
Ever wondered if you could use Selenium IDE for Chrome? You’ve probably heard that the IDE only runs in Firefox, which means Google’s much-famed browser is out of reach. Actually, there’s a neat little feature that lets you run Selenium IDE in Chrome.
The feature is called WebDriver Playback. Here’s how you can use it:
Launch Selenium IDE.
Go to ‘Options’ and select “Options…” in the drop-down menu.
In the Options menu, select the “WebDriver” tab.
Check the “Enable WebDriver playback” checkbox.
Find the “Browser choices” input field right below the checkbox. Below the input field, you will see browser options. These include “android, chrome, firefox, htmlunit, internet explorer, iPhone, iPad”.
Substitute “firefox” with “chrome”. Note that both variants are lowercase.
Download the Selenium standalone JAR file and ChromeDriver. Add both files to the same folder on your local computer.
Use Terminal to navigate to the folder with the downloaded files.
Start Selenium server and ChromeDriver server via Terminal: java -jar selenium-server-standalone-2.43.1.jar -Dwebdriver.chrome.driver=chromedriver.exe
Open Selenium IDE and run the test script. Note that the script will run in one of the more or less recent versions of Chrome.