Is protractor compatible with chromeless? If so, how can I configure it?
I didn't find any configuration method online or specific documentation to implement chromeless at protractor configuration.
I'm using protractor 3.1.1
Chrome headless mode is available on Mac and Linux in Chrome 59. Windows support is in Chrome 60.
capabilities: {
'browserName': process.env.PROTRACTOR_BROWSER || 'chrome',
// Using headless Chrome
chromeOptions: {
args: ['--headless', '--disable-gpu', '--start-maximized']
}
}
Related
so I am trying to figure out how to config more correctly with mobile and aswell with desktop. Before I explain my issue, I am using this code:
let SpecReporter = require('mochawesome').SpecReporter;
exports.config = {
"browserstackUser": "helloworld",
"browserstackKey": "123456789",
multiCapabilities: [
//{
// browserName: 'Android',
// device: 'Google Pixel 4 XL',
// os_version: '10.0',
// real_mobile: "true",
// project: "Selenium-Test",
// build: "Build T-Hour",
// name: "Pixel 4 XL Android - Happy Flow"
//},
{
browserName: 'Chrome',
device: 'Samsung Galaxy S9 Plus',
os_version: '9.0',
real_mobile: "true",
project: "Selenium-Test",
build: "Build T-Hour",
name: "Samsung Galaxy S9 Plus Chrome - Happy Flow"
}
],
maxSessions: 1,
mochaOpts: {
reporter: "mochawesome",
timeout: 60000,
},
suites: {
all: 'pagesMobile/*.js',
},
framework: 'mocha',
};
As you can see I have different multiCapabilities where I can add on different browsers whenever I want to test.
However my issue is that I do feel like I am doing it incorrectly because I have entered browserName : Chrome to test on however it still does Samsung browser instead and I am not sure what I am doing wrong anymore.
I do feel like I have set it up incorrectly and I am here asking what I am doing wrong that it doesn't want to run Chrome as a browser from Mobile and also if there is someone that is willing to tell me what I can improve aswell.
BrowserStack currently supports only the Chrome Browser on Android and the Safari Browser on iOS real mobile devices. So, your tests on the Samsung Mobile devices should execute on the Chrome Browser by default.
Chrome version: 57.0.2987.110 Chrome web driver: 2.28 Protractor:
5.1.2 Node: 6.9.1
When I run my scripts via protractor I see this error:
ERROR:configuration_policy_handler_list.cc(92)] Unknown policy:
DnsPrefetchingEnabled ERROR:configuration_policy_handler_list.cc(92)]
Unknown policy: PasswordManagerAllowShowPasswords
When I run the similar test case via Java selenium it works fine & does not return error like above.
So I am assuming local group policy is not an issue here but protractor is dealing with web driver in a different way than Java.
I have tried these Chrome options:
'chromeOptions': {
'args': ['incognito','--no-sandbox','--disable-gpu',
'--disable-web-security','--DNS-prefetch-disable']
}
'chromeOptions': {'args': ['lang=en-GB', 'enable-precise-memory-info' , 'js-flags=--expose-gc', 'no-sandbox']}
I'm using this and works perfect for me.
Some time ago google announced that headless chrome is available in newest chrome versions.
Over there we can find config for headless chrome with protractor.
When I'm trying to run my test suite with directConnect - everything works as a charm.
capabilities looks like that:
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: ['--start-maximized']
}
},
When I change args line to:
args: ['--start-maximized', '--headless', '--disable-gpu']
and run tests, I receive an error:
E/protractor - Could not find Angular on page https://address.com/ : retries looking for angular exceeded
Unhandled rejection Error: Angular could not be found on the page https://address.com/.If this is not an Angular application, you may need to turn off waiting for Angular.
Please see
https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular-on-page-load
at executeAsyncScript_.then (/home/user/Projects/pef/tests/e2e/node_modules/protractor/lib/browser.ts:936:29)
at ManagedPromise.invokeCallback_ (/home/user/Projects/pef/tests/e2e/node_modules/selenium-webdriver/lib/promise.js:1366:14)
at TaskQueue.execute_ (/home/user/Projects/pef/tests/e2e/node_modules/selenium-webdriver/lib/promise.js:2970:14)
at TaskQueue.executeNext_ (/home/user/Projects/pef/tests/e2e/node_modules/selenium-webdriver/lib/promise.js:2953:27)
at asyncRun (/home/user/Projects/pef/tests/e2e/node_modules/selenium-webdriver/lib/promise.js:2813:27)
at /home/user/Projects/pef/tests/e2e/node_modules/selenium-webdriver/lib/promise.js:676:7
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
Have anyone faced with this issue?
node: v8.4.0
npm: 5.3.0
chrome: 60.0.3112.113
protractor: 5.1.2
I'm getting a UnsupportedOperationError: Build info: version: '3.3.1', revision: '5234b32', time: '2017-03-10 09:04:52 -0800' when i run my protractor 5.0.0 tests on safari.
I have a webdriver 2.48.0 extension enabled in safari.
conf file:
capabilities: {
name: 'Safari',
browserName: 'safari',
logName: 'Safari',
shardTestFiles: true,
maxInstances: 2
}
seleniumAddress: 'http://localhost:4444/wd/hub'
I'm starting the server manually by
./node_modules/.bin/webdriver-manager start
and running the spec in a different terminal
Am I supposed to run a specific version of selenium server. Any help would be appreciated.
macOS Sierra with Safari 10.0.2 needs the new Safari Driver. The Safari webdriver 2.48.0 extenson is for Safari 9 and lower.
There are some issues with the new Safari driver, see also here and search Google ;-).
Keep in mind that for example the Wait For Angular doesn't work, to avoid that use browser.ignoreSynchronization = true;
i'm using Protractor + Jasmine + Selenium WebdriverJS for automating angularjs application. I was able to configure and setup a sample script with all these tools to run on a desktop computer.
Now I want to run the same scripts on mobile( IOS & Android ) device / emulator.
I'm looking to use appium to run protractor scripts on IOS and Android. If anyone who has worked on protractor and appium. Please help me set up a sample script.
i'm pretty new to all these tools any Info on this is really helpful.
at https://github.com/angular/protractor/blob/master/docs/browser-setup.md you can find very detailed informations how to setup appium with protractor to test on emulators (Android/iOS)
you have to replace the webdriver of protractor with the appium webdriver. the appium webdriver is running normally at port 4723. the folloing code is for android for a web-only angualr app (no apk, pure web, running in the cromebrowser of the device which must be present)
exports.config = {
seleniumAddress: 'http://localhost:4723/wd/hub', //appium
specs: [
'spec.js'
],
capabilities: {
browserName: 'chrome',
'appium-version': '1.0',
platformName: 'Android',
platformVersion: '4.4.2',
deviceName: 'Android Emulator',
},
baseUrl: 'http://yourwebsite.com'),
};
start appium and run test with
protractor yourtest.js
edit: adapting capabilities to recent version (browserName must be present for selenium 2.43.x)
Have you tried using SauceLabs? I think you can request iOS and Android devices by specifying the platform in the capabilities section of the config.
If you don't want to use SauceLabs you can look at using Selenium's Grid functionality. You can get Selenium drivers for iOS and Android and have them connect to a centralized Selenium server that your Protractor scenarios are ran against, you just change the seleniumAddress in your config file to point to the centralized server.
Basically, you have to connect to the devices remotely and the easiest ways are as stated above.
just wanted to share that this configuration worked for me against BrowserStack.-
multiCapabilities: [
{
platformName: 'iOS',
platformVersion: '7.1',
browserName: '',
app: 'safari',
deviceName: 'iPhone Simulator',
'appium-version': "1.4.0",
username: '<username>',
accessKey: '<key>'
}
,
{
platformName: 'Android',
platformVersion: '4.4',
browserName: 'Browser',
deviceName: 'Android Emulator',
'appium-version': "1.4.0",
username: '<username>',
accessKey: '<key>'
}
],
I've found that other values for platformVersion different that the ones that I placed here, does not work, you'll get this error message like: 'Angular was not found....'
I've created a ticket for protractor team and a comment:
https://github.com/angular/protractor/issues/2247