I am trying to run test on Safari browser, it is working when run selenium server with selenium "selenium-server-standalone-2.47.1.jar" it working fine.
I have downloaded and installed safari webdriver driver extension.
Using Safari browser: 5.1.7 on window machine.
I added browser configuration in conf file:
'browserName': 'safari'"
When I am running server with
webdriver-manager start
Getting below exception and safari browser not launched.
:\Users\Admin\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-
webdriver\error.js:27
super(opt_error);
^
WebDriverError: The best matching driver provider org.openqa.selenium.ie.InternetExplorerDriver can't create a new driver instance for Capabilities [{count=1, browserName=safari}]
Build info: version: '2.52.0', revision: '4c2593c', time: '2016-02-11 19:06:42'
System info: host: 'Admin-PC', ip: '10.253.10.4', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_65'
Driver info: driver.version: unknown at WebDriverError C:\Users\Admin\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\error.js:27:10)
at Object.checkLegacyResponse (C:\Users\Admin\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\error.js:580:13)
at C:\Users\Admin\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:64:13
at Promise.invokeCallback_ (C:\Users\Admin\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:1329:14)
at TaskQueue.execute_ (C:\Users\Admin\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2790:14)
at TaskQueue.executeNext_ (C:\Users\Admin\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2773:21)
at C:\Users\Admin\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2652:27
at C:\Users\Admin\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:639:7 at process._tickCallback (node.js:369:9)From: Task: WebDriver.createSession()
at acquireSession (C:\Users\Admin\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:62:22)
at Function.createSession (C:\Users\Admin\AppData\Roaming\npm\node_modules\protractor\node_modules\seleniu-webdriver\lib\webdriver.js:295:12) at Builder.build (C:\Users\Admin\AppData\R oaming\npm\node_modules\protractor\node_modules\selenium-webdriver\builder.js:458:24)
at [object Object].DriverProvider.getNewDriver (C:\Users\Admin\AppData\Roaming\npm\node_modules\protractor\built\driverProviders\driverProvider.js:42:27)
at [object Object].Runner.createBrowser (C:\Users\Admin\AppData\Roaming\npm\node_modules\protractor\built\runner.js:203:37)
at C:\Users\Admin\AppData\Roaming\npm\node_modules\protractor\built\runner.js:293:21
at _fulfilled (C:\Users\Admin\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:834:54)
at self.promiseDispatch.done (C:\Users\Admin\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:863:30)
at Promise.promise.promiseDispatch (C:\Users\Admin\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:796:13)
at C:\Users\Admin\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:556:49
Let me know what I am missing.
I belive you should use like this
multiCapabilities: [{
name: 'ChromeIphone',
logName: 'Chrome Iphone',
browserName: 'chrome',
chromeOptions: {
'args': ['user-agent=Mozilla/5.0 (iPhone; CPU iPhone OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12A405 Safari/600.1.4']
},
mobileEmulationEnabled: true
}]
in your conf.js file cause protractor works on windows machine with chromium and you have to set user-agent parameter to show that your go to your page through safari browser. So you are not able to run Safari browser directly on windows machine only through chrome driver.
Related
I am getting the error below when trying to run Protractor test against chrome.
session not created exception: Chrome version must be >= 59.0.3071.0
[11:42:23] E/launcher - session not created exception: Chrome version must be >= 59.0.3071.0 (Driver info: chromedriver=2.32.498550 (9dec58e66c31bcc53a9ce3c7226f0c1c5810906a),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide
any stacktrace information) Command duration or timeout: 6.44 seconds Build info: version: '3.5.3', revision: 'a88d25fe6b', time: '2017-08-29T12:54:15.039Z' System info: host: 'PC328569', ip: '10.25.227.179', os.name: 'Windows 7', os.arch: 'amd64', os.version:
'6.1', java.version: '1.8.0_121' Driver info: driver.version: unknown [11:42:23] E/launcher - SessionNotCreatedError: session not created exception: Chrome version must be >= 59.0.3071.0 (Driver info: chromedriver=2.32.498550 (9dec58e66c31bcc53a9ce3c7226f0c1c5810906a),platform=Windows
NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 6.44 seconds Build info: version: '3.5.3', revision: 'a88d25fe6b', time: '2017-08-29T12:54:15.039Z' System info: host: 'PC328569', ip:
'10.25.227.179', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_121' Driver info: driver.version: unknown at WebDriverError (D:\Balachander\DailyScript\node_modules\selenium-webdriver\lib\error.js:27:5) at SessionNotCreatedError
(D:\Balachander\DailyScript\node_modules\selenium-webdriver\lib\error.js:214:5) at Object.checkLegacyResponse (D:\Balachander\DailyScript\node_modules\selenium-webdriver\lib\error.js:505:15) at parseHttpResponse (D:\Balachander\DailyScript\node_modules\selenium-webdriver\lib\http.js:509:13)
at doSend.then.response (D:\Balachander\DailyScript\node_modules\selenium-webdriver\lib\http.js:440:13) at process._tickCallback (internal/process/next_tick.js:103:7) From: Task: WebDriver.createSession() at Function.createSession (D:\Balachander\DailyScript\node_modules\selenium-webdriver\lib\webdriver.js:777:24)
at Function.createSession (D:\Balachander\DailyScript\node_modules\selenium-webdriver\chrome.js:709:29) at createDriver (D:\Balachander\DailyScript\node_modules\selenium-webdriver\index.js:167:33) at Builder.build (D:\Balachander\DailyScript\node_modules\selenium-webdriver\index.js:623:16)
at Hosted.getNewDriver (D:\Balachander\DailyScript\node_modules\protractor\lib\driverProviders\driverProvider.ts:60:29) at Runner.createBrowser (D:\Balachander\DailyScript\node_modules\protractor\lib\runner.ts:225:39) at q.then.then (D:\Balachander\DailyScript\node_modules\protractor\lib\runner.ts:391:27)
at _fulfilled (D:\Balachander\DailyScript\node_modules\q\q.js:834:54) at self.promiseDispatch.done (D:\Balachander\DailyScript\node_modules\q\q.js:863:30) at Promise.promise.promiseDispatch (D:\Balachander\DailyScript\node_modules\q\q.js:796:13) [11:42:23]
E/launcher - Process exited with error code 199
Versions of the executables used:
webdriver manager - 12.0.6
protractor - 5.1.2
chrome driver - 2.32
Java - 1.8
What I have tried:
1.Updating the webdriver to latest version
npm update -g protractor
webdriver-manager update
2.Editing Protractor's config file: node_modules/protractor/config.json
Changing the chrome driver version to whatever you need. eg. "chromedriver": "2.24".Run webdriver-manager update.
But for some reason webdriver-manager always uses chrome driver 2.32.
Any help or suggestion is appreciated. Thanks.
As per Below references you need to update your actual installed chrome.
Update chrome by :- About Google Chrome
Menu -> Help ->
Refer :-
https://github.com/appveyor/ci/issues/1600
Chromedriver error "Chrome version must be >= 52" using Nightwatch
Hope it will help you :)
I am just upgrading to selenium-server-standalone-3.0.1 on our Selenium Grid hub and on the nodes.
What I realised is, that the JSON config has slightly changed (https://github.com/SeleniumHQ/selenium/wiki/Grid2).
After changing my configuration accordingly the node is starting fine. However I can not run any tests on firefox because I get the following error:
Exception: Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: VISTA
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'ebc-vie-selenium-node-01', ip: '10.100.0.157', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_71'
Driver info: driver.version: FirefoxDriver
The JSON configuration looks like this:
"capabilities":
[
{
"browserName": "firefox",
"version": "49.0.2",
"platform": "WINDOWS",
"firefox_binary": "C:\\Program Files (x86)\\Mozilla Firefox\\ESR\\Firefox_49.0.2\\firefox.exe",
"maxInstances": 5,
"seleniumProtocol": "WebDriver"
},
When I set the firefox_binary directly from Java code it works fine (with Gecko Driver)
desiredCapabilities.setCapability("firefox_binary", "C:\\\\Program Files (x86)\\\\Mozilla Firefox\\\\ESR\\\\Firefox_49.0.2\\\\firefox.exe");
Any idea why that is happening respectively how the JSON configuration has changed for version 3.0.1
I am getting the following error on resetting the app [driver.resetApp()] and on launching the app on Appium (version: 1.4.16.1). I am using Java.
Eclispe console
org.openqa.selenium.WebDriverException: chrome not reachable
(Session info: chrome=50.0.2661.86)
(Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 2.08 seconds
Build info: version: '2.48.2', revision: '41bccdd', time: '2015-10-09 19:59:12'
System info: host: 'IN2084073W1', ip: '192.168.56.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_21'
*** Element info: {Using=id, value=password}
Session ID: 2968b7e9-948e-4b75-94ed-838d10a08c82
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities [{platform=LINUX, app=C:/apk/appname.apk, javascriptEnabled=true, appActivity=.MainActivity, browserName=, networkConnectionEnabled=true, desired={newCommandTimeout=120, app=C:/apk/surveyorapp.apk, platformVersion=5.1, deviceName=TA93303Q2F, platformName=Android, appActivity=.MainActivity, browserName=, appPackage=com.axa.surveyorapp}, locationContextEnabled=false, appPackage=com.axa.surveyorapp, newCommandTimeout=120, platformVersion=5.1, databaseEnabled=false, deviceName=TA93303Q2F, platformName=Android, webStorageEnabled=false, warnings={}, takesScreenshot=true}]
Appium Log
error: Could not proxy command to remote server. Original error: Error: read ECONNRESET
error: Chromedriver: Chromedriver exited unexpectedly with code 3221225477, signal null
info: Chromedriver: Changed state to 'stopped'
warn: Chromedriver for context WEBVIEW_com.clientname.appname stopped unexpectedly
error: Chromedriver quit unexpectedly during session
Update
Thanks for the update Emna. I have tried your option.
Can you please let me know how exactly I need to add this. I am using AndroidDriver not AppiumDriver. I have tried with both, but I'm getting below error.
Try to use :
(AppiumDriver)driver.resetApp();
Instead of :
driver.resetApp();
You can have a look into this link: Appium java-client
and use this link also to download ;)
I'm trying to solve it for days, please help me!
I'm running my protractor tests using chrome, firefox and internet explorer, but when I try to run the same test in Safari, I get the following error:
ScriptTimeoutError: Timed out awaiting response to command "executeScript" after 30003 ms (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 30.08 seconds
Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50'
System info: host: 'myPC', ip: '192.168.0.12', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_45'
Driver info: org.openqa.selenium.safari.SafariDriver
Capabilities [{browserName=safari, takesScreenshot=true, javascriptEnabled=true, version=5.1.7, cssSelectorsEnabled=true, platform=WINDOWS, secureSsl=true}]
Session ID: null
The error comes when I try to get some url like browser.get('https://www.google.com'); I tried to run the same test in Safari in my colleague's macbook to see if the problem is my windows environment (and the older safari version 5.1.7) but had the same problem. I also tried to change the allScriptsTimeout and got the same problem, I tried many different configurations in my protractor configuration file and it didn't worked =(
I'm sure that I"m doing something wrong but have no ideia about what... I didn't found more information about this error.
Edit: There is a known issue (https://github.com/angular/protractor/issues/2111) about using protractor with safari
I'm trying to run a simple protractor test in IE11 on Win 8.1.
My test:
it("should navigate to from the homepage to the add contact page", function () {
browser.get("http://localhost:4000/");
// ... it already crashes here
});
My config:
exports.config = {
// run in multiple browsers
multiCapabilities:[
{
'browserName': 'internet explorer',
}
],
specs: ['./**/*js'],
// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
},
onPrepare: function () {
require('jasmine-reporters');
jasmine.getEnv().addReporter(
new jasmine.JUnitXmlReporter('xmloutput', true, true)
);
}
};
The error:
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
Selenium standalone server started at http://169.254.80.80:31289/wd/hub
[31mF[0m
Failures:
1) add new contact page should navigate to from the homepage to the add contact page
Message:
[31mUnknownError: JavaScript error (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 63 milliseconds
Build info: version: '2.44.0', revision: '76d78cf', time: '2014-10-23 20:02:37'
System info: host: 'Florian-Lenovo', ip: '169.254.80.80', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_25'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{browserAttachTimeout=0, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.usePerProcessProxy=false, ignoreZoomSetting=false, handlesAlerts=true, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:22540/, takesScreenshot=true, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=dismiss}]
Session ID: 2b2e9619-3eb8-493f-bc9d-5354a91f7f8b[0m
Stacktrace:
UnknownError: JavaScript error (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 63 milliseconds
Build info: version: '2.44.0', revision: '76d78cf', time: '2014-10-23 20:02:37'
System info: host: 'Florian-Lenovo', ip: '169.254.80.80', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_25'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{browserAttachTimeout=0, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.usePerProcessProxy=false, ignoreZoomSetting=false, handlesAlerts=true, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:22540/, takesScreenshot=true, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=dismiss}]
Session ID: 2b2e9619-3eb8-493f-bc9d-5354a91f7f8b
at new bot.Error (C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:113:18)
at Object.bot.response.checkResponse (C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\response.js:106:9)
at C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:362:20
at C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\base.js:1582:15
at [object Object].webdriver.promise.ControlFlow.runInNewFrame_ (C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1654:20)
at notify (C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:465:12)
at notifyAll (C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:442:7)
at resolve (C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:420:7)
at [object Object].fulfill (C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:535:5)
at C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1520:10
==== async task ====
Protractor.get(http://localhost:4000/) - reset url
at [object Object].webdriver.WebDriver.schedule (C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:345:15)
at [object Object].Protractor.executeScript_ (C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\lib\protractor.js:223:22)
at [object Object].Protractor.get (C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\lib\protractor.js:440:8)
at [object Object].<anonymous> (C:\OneDrive\Projects\Gyst\Gyst.Web\Scripts\tests\e2e\contacts\addNewContactSpecs.ts:10:17)
at C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd\index.js:94:14
at [object Object].webdriver.promise.ControlFlow.runInNewFrame_ (C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1654:20)
at [object Object].webdriver.promise.ControlFlow.runEventLoop_ (C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1518:8)
==== async task ====
Asynchronous test function: it()
at [object Object].<anonymous> (C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd\index.js:93:33)
at [object Object].<anonymous> (C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\minijasminenode\lib\async-callback.js:45:37)
at [object Object].jasmine.Block.execute (C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\minijasminenode\lib\jasmine-1.3.1.js:1174:17)
at [object Object].jasmine.Queue.next_ (C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\minijasminenode\lib\jasmine-1.3.1.js:2209:31)
at onComplete (C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\minijasminenode\lib\jasmine-1.3.1.js:2205:18)
at [object Object].jasmine.WaitsForBlock.execute (C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\minijasminenode\lib\jasmine-1.3.1.js:2704:5)
at [object Object]._onTimeout (C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\minijasminenode\lib\jasmine-1.3.1.js:2718:12)
Error
at [object Object].<anonymous> (C:\OneDrive\Projects\Gyst\Gyst.Web\Scripts\tests\e2e\contacts\addNewContactSpecs.ts:9:5)
at [object Object].jasmine.Env.describe_ (C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\minijasminenode\lib\jasmine-1.3.1.js:913:21)
at [object Object].jasmine.Env.describe (C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\minijasminenode\lib\jasmine-1.3.1.js:898:15)
at describe (C:\Users\Florian\AppData\Roaming\npm\node_modules\protractor\node_modules\minijasminenode\lib\jasmine-1.3.1.js:658:27)
at Object.<anonymous> (C:\OneDrive\Projects\Gyst\Gyst.Web\Scripts\tests\e2e\contacts\addNewContactSpecs.ts:1:34)
Finished in 1.015 seconds
[31m1 test, 1 assertion, 1 failure
[0m
Shutting down selenium standalone server.
[launcher] 0 instance(s) of WebDriver still running
[launcher] internet explorer #1 failed 1 test(s)
[launcher] overall: 1 failed spec(s)
[launcher] Process exited with error code 1
I'm still pretty new to protractor and I don't have a clue what to do with this.
My tests run fine in Chrome and Firefox.
Any ideas?
try this one, for me it helped with a similar error saying A Jasmine spec timed out. Resetting the WebDriver Control Flow.
protractor-conf.js
{"browserName": "internet explorer",
"ie.forceCreateProcessApi": true,
"ie.browserCommandLineSwitches": "-private",
"ie.ensureCleanSession": "true",
"seleniumAddress": 'http://10.0.1.XXX:4444/wd/hub'
}
Ensure that TabProcGrowth" = dword: 00000000 in Path HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main is set.
IEExplorerDriver is expected to implement asynchronous script executions except that there are a couple of known issues, that the driver can be slow and often times out waiting for page load:
http://angular.github.io/protractor/#/browser-setup
https://github.com/angular/protractor/issues/1052
In your case as per the logs you provided, the lines somehow indicates a timeout has happen.
It's still an open issue for the Protactor team and hopefully, they will come up with a solution soon.
Another thing to possibly consider is that, Protactor uses Promises in order to execute scripts asynchronously, which in terms of browser support is currently still in Preview release in IE11
https://status.modern.ie/promiseses6
For none angular sites instead of driver.get use below code .
browser.driver.get("https://material.angularjs.org/latest/demo/radioButton");
Also go Internet options in IE>IE options and enable protected mode for all the zones
I managed to solve this with below capabilities in my config,js
onPrepare: function () {
browser.driver.ignoreSynchronization = true;// for non-angular set true. default value is false
browser.waitForAngularEnabled(false); // for non-angular set false. default value is true
browser.driver.manage().window().setSize(1280, 1024);
},
capabilities: {
browserName: 'internet explorer',
platform: 'ANY',
version: '11'
},