I need to launch Microsoft edge browser through selenium grid, but whenever I try to launch the browser below error thrown and browser is not initiated
org.openqa.selenium.SessionNotCreatedException: Unable to create new service: EdgeDriverService Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:32:19.891Z' System info: host: 'ERD-L046', ip: '192.168.2.46', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_131' Driver info: driver.version: unknown Command duration or timeout: 74 milliseconds
To configure a grid set up I have used the below code :
To set up HUB :
java -jar selenium-server-standalone-3.13.0.jar -role hub
To set up Node :
java -Dwebdriver.edge.driver="D:/Softwares/Selenium/IEDriver/MicrosoftWebDriver.exe" -jar selenium-server-standalone-3.13.0.jar -port 5567 -role node -hub http://192.168.2.46:4444/grid/register -browser "browserName=MicrosoftEdge, maxInstances=5"
To launch the browser I have used the below code :
EdgeOptions options = new EdgeOptions();
options.setCapability("platform", "Any");
options.setCapability("browserName", "MicrosoftEdge");
options.setCapability("ignoreZoomSetting", true);
options.setCapability("browserVersion", "41.16299.15.0");
System.setProperty("webdriver.edge.driver", "D:/Softwares/Selenium/Drivers/IEDriver/MicrosoftWebDriver.exe");
driver = new RemoteWebDriver(new URL("http://192.168.2.46:5567/wd/hub"), options);
OS : Windows 10 pro [version 1709 16299.125]
Browser version : 41.16299.15.0
Selenium Version : 3.13.0
Selenium server standalone : 3.13.0
Microsoft WebDriver version : Release 16299 | Version: 5.16299 | Edge version supported: 16.16299
Kindly someone shed light on this.
Please recheck on Driver calling path calling, In mentioned path it includes folder IEDriver. Also you can check with forward double slash.
Related
My Protractor tests that use sendKeys to press Enter or Tab failed today after I was auto-updated to Chrome 76.
This worked find yesterday on Chrome 75.
This is the code that used to work:
browser.actions().sendKeys(protractor.Key.TAB).perform();
The error message is
Failed: sendKeysToActiveElement
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'DESKTOP-6JGLC4V', ip: '192.168.0.5', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_221'
Driver info: driver.version: unknown
Our Angular application has drop-down menus where you have to click outside of the drop-down or press the Tab key to close it. So I'm not sending the key stroke to an input element. I've tried $('body').sendKeys(protractor.Key.TAB); but that doesn't seem to work.
This error message...
Failed: sendKeysToActiveElement
...implies that the ChromeDriver was unable to invoke sendKeys() to the ActiveElement.
This issue started to surface when ChromeDriver / Chrome switched over to W3C support.
#AutomatedTester in the discussion UnsupportedOperationError: sendKeysToActiveElement with sendkeys mentions, this may be an issue within the Actions class within the Client bindings.
There should be a little shim in the bindings that make sure the same functionality is given on older commands that have been removed. This has been implemented in the core selenium binding.
The Python example:
def send_keys(self, *keys_to_send):
"""
Sends keys to current focused element.
:Args:
- keys_to_send: The keys to send. Modifier keys constants can be found in the
'Keys' class.
"""
typing = keys_to_typing(keys_to_send)
if self._driver.w3c:
for key in typing:
self.key_down(key)
self.key_up(key)
else:
self._actions.append(lambda: self._driver.execute(
Command.SEND_KEYS_TO_ACTIVE_ELEMENT, {'value': typing}))
return self
def send_keys_to_element(self, element, *keys_to_send):
"""
Sends keys to an element.
:Args:
- element: The element to send keys.
- keys_to_send: The keys to send. Modifier keys constants can be found in the
'Keys' class.
"""
self.click(element)
self.send_keys(*keys_to_send)
return self
Solution
#barancev have already merged the required changes through the commit Renaming back 'py' directory, use of 'legacy_create_init' argument and this issue would get completely resolved with the next release of ChromeDriver v77.0 / Chrome v77.0.
The good news is ChromeDriver v77.0 is already released containing the following fixes. From the Release Notes of ChromeDriver v77.0:
Resolved issue 2975: Webdriver Actions for keys (CONTROL, SHIFT etc..) not working in ChromeDriver 75.0.3770.8 [Pri-2]
Resolved issue 2981: Chromedriver in W3C mode loses mouse state between Actions API calls [Pri-2]
Outro
Protractor.Key.Enter is not working in ChromeDriver v75.0.3770.8
Upgraded to chromeDriver 77 and still running into the same issue as mentioned above.
await elem.sendKeys(protractor.Key.TAB); also tried: await browser.actions().sendKeys(protractor.Key.TAB).perform();
`- Failed: sendKeysToActiveElement
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'GC02XYZ...', ip: 'fe80:xyz...', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.6', java.version: '11.0.1'
Driver info: driver.version: unknown`
`chromeDriver -v
ChromeDriver 77.0.3865.40`
When using chrome 74+ please add the below at configuration.js file
exports.config = {
seleniumAddress : 'http://localhost:4444/wd/hub',
specs: ['spec.js'],
capabilities:{
'browserName': 'chrome',
'goog:chromeOptions': {
w3c: false
}
}
};
Notes:
refer the this link
https://github.com/angular/protractor/issues/5274#issuecomment-522258213
When I start the selenium test with gird (Remote control), I see this ERROR on log. The browser is not able to open. I did check and tried the following things:
Stop and start both hub and node. I use the default commands to start hub and node. From command prompt, I see that the node was registered successfully and ready to use
Clean Eclipse Project at Project>Clean
Restart my PC
Disconnect VPN
Use latest selenium standalone 3.6; chromedriver.exe
Check the path to chromedriver.exe
Use my PC as hub and another PC as node
Please note that this issue only happen if I run the test with grid (remote control). The test can run normally locally.
2017-10-20 15:23:37,805 ERROR [Log] Class Utils | Method OpenBrowser | Exception desc : Unable to create new service: ChromeDriverService
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T16:15:40.131Z'
System info: host: 'MY-PC', ip: 'xx.xxx.xxx.xx', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_121'
Driver info: driver.version: unknown
Command duration or timeout: 319 milliseconds
Please give me advice in this case. Thanks!
I have set up an ANT project to write my UI automation framework using Selenium 3.4.0. I am using Gecko driver v18.0 for supporting latest FF browser v55.
java version I am using is 1.8. This project initializes the FF browser with "desired capabilities" object and completes the test. IDE used for this project is Eclipse (Enide 2015). The unit testing framework here is TestNG.
I tried to replicate the same in a maven project using 3.4.0 selenium & Gecko driver v18.0. IDE I am using is IntelliJ. But here after the code executes the driver-initialize part, the browser window opens and then the control never comes back to selenium. The browser remains open for 10-15 min & process keeps running in the background. I have to stop the run to come out of it. Unit testing framework for Maven project here JBehave.
So I did few hit and trails to see the compatibility between Selenium and Gecko driver for Firefox:
Selenium 3.4.0 | Firefox v55 | Gecko Driver version - v15 for 32/64 bit |
Result:
After Initializing FF browser, control does not return back to Selenium.
Selenium 3.4.0 | Firefox v55 | Gecko Driver version - v16 for 32/64 bit |
Result:
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{moz:firefoxOptions={binary=Optional.empty, args=[], legacy=false, logLevel=null, prefs={}, profile=null}}], required capabilities = Capabilities [{}]
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'XXXXX', ip: 'xxx.xxx.xx.xx', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_45'
Driver info: driver.version: FirefoxDriver
Selenium 3.5.1 | Firefox v55 | Gecko Driver version - v15-v19 for 32/64 bit |
Result:
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{moz:firefoxOptions={binary=Optional.empty, args=[], legacy=false, logLevel=null, prefs={}, profile=null}}], required capabilities = Capabilities [{}]
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'XXXXX', ip: 'xxx.xxx.xx.xx', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_45'
Driver info: driver.version: FirefoxDriver
Selenium 2.53.1 | Firefox v55 | Gecko Driver version - v15 for 32/64 bit |
Result:
WebDriverException: Failed to connect to binary FirefoxBinary(C:\Program Files (x86)\Mozilla Firefox\firefox.exe) on port 7055
Selenium 2.53.1 | Chrome |
Result:
Test code executed successfully.
Selenium 3.5.1 | Firefox v54 | Gecko Driver version - v16 for 32/64 bit |
Result:
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{moz:firefoxOptions={binary=Optional.empty, args=[], legacy=false, logLevel=null, prefs={}, profile=null}}], required capabilities = Capabilities [{}]
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'XXXXX', ip: 'xxx.xxx.xx.xx', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_45'
Driver info: driver.version: FirefoxDriver
I have read through most links mentioned below but it did not help-
Selenium 3.4.0 with Firefox 55
https://seleniumhq.wordpress.com/2017/08/09/firefox-55-and-selenium-ide/
Selenium 3.0 Firefx Driver fails with org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session
Unable to create new remote session - Selenium webdriver
https://github.com/mozilla/geckodriver/issues/749
https://github.com/SeleniumHQ/selenium/issues/3630
For the first entry above (...which is Selenium 3.4.0, Firefox v55 and Gecko drover v15 for 32/64 bit windows), when I did Ctrl+Shift+J I got the below log-
1505982873005 addons.xpi WARN Error parsing extensions state: [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [amIAddonManagerStartup.readStartupData]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: resource://gre/modules/addons/XPIProvider.jsm :: loadExtensionState :: line 1596" data: no] Stack trace:
loadExtensionState()#resource://gre/modules/addons/XPIProvider.jsm:1596 < getInstallState()#resource://gre/modules/addons/XPIProvider.jsm:1631 < checkForChanges()#resource://gre/modules/addons/XPIProvider.jsm:3152 < startup()#resource://gre/modules/addons/XPIProvider.jsm:2246 < callProvider()#resource://gre/modules/AddonManager.jsm:271 < _startProvider()#resource://gre/modules/AddonManager.jsm:741 < startup()#resource://gre/modules/AddonManager.jsm:908 < startup()#resource://gre/modules/AddonManager.jsm:3122 < observe()#jar:file:///C:/Program%20Files%20(x86)/Mozilla%20Firefox/omni.ja!/components/addonManager.js:65
While creating services from category 'profile-after-change', service for entry 'Notification Telemetry Service', contract ID '#mozilla.org/notificationTelemetryService;1' does not implement nsIObserver.
Warning: unrecognized command line flag --marionette
nsBrowserContentHandler.js:726
PAC file installed from http://autocache.hpecorp.net/
Property contained reference to invalid variable. Error in parsing value for ‘color’. Falling back to ‘inherit’. browser.css:251:7560
DEPRECATION WARNING: Search service falling back to synchronous initialization. This is generally the consequence of an add-on using a deprecated search service API.
My target is to use this framework for UI testing against the latest stable version of IE, Chrome & Firefox browser. Any help in this regard will be helpful.
I am having exactly same issue on MAC osx , I have been looking for solution for a couple of days
508672244107 mozrunner::runner INFO Running command: "/Applications/Firefox.app/Contents/MacOS/firefox-bin" "-marionette" "-profile" "/var/folders/0k/gv7bgjzs157b0mydntwdqj840000gy/T/rust_mozprofile.hixndTibKloe"
1508672244363 addons.xpi WARN Error parsing extensions state: [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [amIAddonManagerStartup.readStartupData]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: resource://gre/modules/addons/XPIProvider.jsm :: loadExtensionState :: line 1554" data: no] Stack trace: loadExtensionState()#resource://gre/modules/addons/XPIProvider.jsm:1554 < getInstallState()#resource://gre/modules/addons/XPIProvider.jsm:1589 < checkForChanges()#resource://gre/modules/addons/XPIProvider.jsm:3109 < startup()#resource://gre/modules/addons/XPIProvider.jsm:2188 < callProvider()#resource://gre/modules/AddonManager.jsm:269 < _startProvider()#resource://gre/modules/AddonManager.jsm:739 < startup()#resource://gre/modules/AddonManager.jsm:906 < startup()#resource://gre/modules/AddonManager.jsm:3090 < observe()#jar:file:///Applications/Firefox.app/Contents/Resources/omni.ja!/components/addonManager.js:65
1508672244714 Marionette INFO Enabled via --marionette
2017-10-22 14:37:25.560 plugin-container[2720:62009] * CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0xad3f, name = 'com.apple.tsm.portname'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2017-10-22 14:37:25.560 plugin-container[2720:62009] * CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x560b, name = 'com.apple.CFPasteboardClient'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2017-10-22 14:37:25.560 plugin-container[2720:62009] void __CFPasteboardSetup() : Failed to allocate communication port for com.apple.CFPasteboardClient; this is likely due to sandbox restrictions
1508672245808 Marionette INFO Listening on port 57372
1508672245923 Marionette DEBUG Register listener.js for window 2147483649
INFO 10/22 11:37:25 o.o.s.r.ProtocolHan~ - Falling back to original OSS JSON Wire Protocol.
INFO 10/22 11:37:25 o.o.s.r.ProtocolHan~ - Falling back to straight W3C remote end connection
22Oct2017 14:37:26,364 [INFO] TestCycle.initializeWebDriver - Error initializining: Unable to create new remote session. desired capabilities = Capabilities [{marionette=true, firefoxOptions=org.openqa.selenium.firefox.FirefoxOptions#67c2e933, browserName=firefox, moz:firefoxOptions=org.openqa.selenium.firefox.FirefoxOptions#67c2e933, version=, platform=ANY}], required capabilities = Capabilities [{}]
Build info: version: '3.0.0', revision: '350cf60', time: '2016-10-13 10:48:57 -0700'
System info: host: 'tlv-mpp6a', ip: '172.29.53.33', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_121'
Driver info: driver.version: FirefoxDriver
i am running selenium for chrome and need to open google page. i am using testng and i have my chrome driver in the path \src\test\resources. i use jdk 1.8 and windows 64
i use the below code and i am not able to load successsfully
ClassLoader classLoader = getClass().getClassLoader();
File file = new File(classLoader.getResource("chromedriver-2.27.exe").getFile());
String path=file.getAbsolutePath();
System.setProperty("webdriver.chrome.driver",path);
WebDriver driver = new ChromeDriver();
driver.get("www.google.com");
i get error
org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: '3.3.1', revision: '5234b325d5', time: '2017-03-10 09:10:29 +0000'
System info: host: 'NANSARI', ip: '172.18.240.141', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_121'
Driver info: driver.version: ChromeDriver
Please advise.
Try it this way and see if it works -
Put the ChromeDriver outside the project directory, say - C:\Selenium_Drivers
Code -
System.setProperty("webdriver.chrome.driver","C:\\Selenium_Drivers\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("www.google.com");
Please use the latest version of Selenium, ChromeDriver and Chrome
Does anyone know how to setup the Microsoft Edge browser with Protractor?
I'm using Protractor (Javascript) and Gulp; NOT Java or C#.
Here's my Protractor config file:
exports.config = {
framework: 'cucumber',
seleniumArgs: ['-Dwebdriver.ie.driver=node_modules/protractor/selenium/MicrosoftWebDriver.exe'],
multiCapabilities: {
'browserName': 'MicrosoftEdge',
javascriptEnabled=true,
//'platform': 'windows',
// 'version': '11'
}
,
{
'browserName': 'chrome',
loggingPrefs: {
driver: 'DEBUG',
server: 'INFO',
browser: 'ALL'
}
}],
}
1. I specify the browser name which is 'MicrosoftEdge' then
2. I thought I would point to the EdgeDriver.exe just like I did and it worked for the IE browser.
What else am I missing, this successfully opens up the Edge browser but fails to navigate to a URL with error
var template = new Error(this.message);
^
UnknownError: null (WARNING: The server did not provide any stacktrace information)
Has anyone successfully set up Microsoft Edge with Protractor/CucumberJS?
I just had the same problem as you outlined,I noticed you and I are running the same build of Windows 10,
I have managed to find a solution to my problem if you see the small print around the download link on https://msdn.microsoft.com/en-us//library/mt188085(v=vs.85).aspx
You'll notice there are three driver versions try install the following one:
Windows 10 Fall 2015 Update, install Microsoft WebDriver Fall 2015 Update.
From the install directory take the 'MicrosoftWebDriver.exe' and replace your current one.
I think you are looking for is the Browser Fingerprint.
While not complete (including MS-Edge), it should point you in the correct direction..
https://en.wikipedia.org/wiki/Device_fingerprint#External_links
Especially - http://www.darkwavetech.com/fingerprint/fingerprint_code.html
Hope this helps!
I ended up doing the following to get Mircosoft Edge to launch from Protractor.
Here's where I got the driver for Microsoft Edge (https://www.microsoft.com/en-us/download/details.aspx?id=48212); you can install the .msi file and it'll give you a .exe which you can drop in to a location of your choice:
Here's my config file for Microsoft Edge:
exports.config = {
framework: 'cucumber',
//Microsoft Edge
seleniumArgs: ['-Dwebdriver.edge.driver=node_modules/protractor/selenium/MicrosoftWebDriver.exe'],
capabilities: {
'browserName': 'MicrosoftEdge',
'platform': 'windows',
// 'version': '11'
},
}
Please note if you wanted to just get IE11 then you would use this instead and make sure to point it to wherever you downloaded the ieDriver (http://www.seleniumhq.org/download/) to your local machine:
seleniumArgs: ['webdriver.ie.driver=node_modules/protractor/selenium/IEDriverServer.exe'],
And don't forget to change the browser name to 'browserName': 'internet explorer',
This is just a step closer to getting Protractor(Javascript and Gulp, please NO Java or C#) to work with Microsoft Edge on Windows 10 OS, this launches the Microsoft Edge browser; however I am still running into issues such as:
var template = new Error(this.message);
^
UnknownError: null (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 6.95 seconds
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'DEV-6', ip: '10.10.50.25', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_65'
Driver info: org.openqa.selenium.edge.EdgeDriver
at new bot.Error
This is a work in progress so I'll update this post as I get more meaningful results; if anyone knows of how to avoid this error to successfully automate Microsoft Edge with Protractor please suggest it here.
And please note I am NOT using the Java or C# bindings which seem to be very popular on Google results; instead I am using Protractor with Javascript and gulp for my e2e tests. Any help much appreciated thanks.
For those who want to start a protractor test with edge, here is the relevant part of my protractor.conf :
seleniumArgs: ['-Dwebdriver.edge.driver=node_modules/protractor/selenium/MicrosoftWebDriver.exe'],
baseUrl: 'http://127.0.0.1:4321/index_protractor.html',
capabilities: {
'browserName': 'MicrosoftEdge'
},
So it's a mix between all you can read on the Internet (note that the case is important with MicrosoftEdge).
On the upside, Edge is started and I see the url changing, etc
On the downside, every test I tried failed with this error :
Message:
Failed: Error while running testForAngular: not implemented (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 3 milliseconds
Build info: version: '2.48.2', revision: '41bccdd', time: '2015-10-09 19:59:12'
System info: host: 'PORTABLE-SL3', ip: '192.168.43.171', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_66'
Driver info: org.openqa.selenium.edge.EdgeDriver
Capabilities [{acceptSslCerts=true, browserVersion=20.10240.16384.0, platformVersion=10, browserName=MicrosoftEdge, takesScreenshot=true, pageLoadStrategy=normal, takesElementScreenshot=true, platformName=windows, platform=ANY}]
Session ID: 732EDD82-B245-4020-8B0E-3FBE0428AAB6
So I guess the driver is not ready for Angular
EDIT:
Confirmed, adding this line before my browser.get fixed my error
browser.ignoreSynchronization=true;
I had to handle the wait for Angular manually though. Please note also that by.repeater was not working