How to fix "UnsupportedOperationError: The command 'POST /session/:id/timeouts/async_script' was not found." e2e tests,Safari,protractor,selenium? - selenium-webdriver

I am trying to run Protractor e2e tests on Selenium and Safari Version 12.1.1 (14607.2.6.1.1) for the AngularJS web application. Those tests are successfully running on Chrome with the Chrome web driver.
I have enabled Develop tab in Safari with "Allow Remote Automation" checked.
I've followed this https://developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari tutorial in order to make sure that my safaridriver is enabled and that I have correct Selenium library version.
Info:
"protractor": "4.0.14",
"selenium-server-standalone-3.141.59.jar"
I run it with "gulp e2e --browsers=safari". The Safari browser starts for a second and then shuts itself down. Error code I get is: Error: UnsupportedOperationError: The command 'POST /session/04A32527-1B80-4171-BB56-4B169A75855E/timeouts/async_script' was not found. Error code 100.
I found that this command since Safari 12 should be supported.

Related

Issue with running selenium scripts in headless browser in gitlab CI beacuse of chrome extension involvement

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.

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

grunt-protractor-runner and Cross-Browser testing

I am able to successfully run test on chrome on my current set-up, however I am unable to add other browsers to my tests. I am using the grunt module 'grunt-protractor-runner' to run my e2e tests.
Having looked around I know the grunt-protractor-runner module does support multiCapabilities, so on the face of it I would expect the simple task of editing the target config file to include multiCapabilities and update chromeOnly to false.
Although I can pass multiCapabilities, I cannot however change the chromeOnly option to 'false' and get my tests to run successfully. My errors when passing Firefox and Chrome to multiCapabilities,
Running 2 instances of WebDriver[launcher] Runner Process Exited With Error Code: 8
------------------------------------
PID: 7812 (capability: chrome #1)
------------------------------------
Using the selenium server at http://localhost:4444/wd/hub
C:\Project\node_modules\protractor\node_modules\selenium- webdriver\lib\webdriver\promise.js:1702
throw error;
^
------------------------------------
PID: 6444 (capability: firefox #1)
------------------------------------
Using the selenium server at http://localhost:4444/wd/hub
C:\Project\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1702
throw error;
^
I am running my set-up on Windows 7, using grunt-protractor-runner 1.0.1, protractor 0.23.1, chromedriver 2.9, and selenium-server-standalone 2.41.0
It would seem that I've been able to resolve this problem - it related to not starting a standalone selenium server, which grunt-protractor-runner does not do on it's own.
The way around this is to either open a new console at the location of the protractor web-driver using webdriver-manager start --standalone and running the tests using grunt-protractor-runner as before; or as I am currently, using the grunt-protractor-webdriver module and including it within the grunt task to be called.
In my protractor.conf.js file I removed chromeOnly: true and added a multiCapabilities array of browsers.

E2E Testing in Protractor using Firefox or Safari?

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

Is it possible to connect Selenium-IDE to ChromeDriver

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.

Resources