Microsoft Edge WebDriver throws 'Unexpected error. Unknown error' when you try to initialize - selenium-webdriver

I am getting the following exception when I try to initialize the webdriver instance for Microsoft EdgeDriver. I am using the MicrosoftDriver version - 16.16299.0
I have verified the version of OS and Edge on my machine and used the WebDriver version accordingly.
OS Build : 16299.1087
Microsoft Edge : 41.16299.1004.0
Selenium.WebDriver.MicrosoftDriver : 16.16299.0
EdgeDriver edge = new EdgeDriver(path);
Below is the error message:
{"Unexpected error. Unknown error"}
Type: OpenQA.Selenium.WebDriverException
Stack Trace:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
at OpenQA.Selenium.Edge.EdgeDriver..ctor(String edgeDriverDirectory, EdgeOptions options)
at OpenQA.Selenium.Edge.EdgeDriver..ctor(String edgeDriverDirectory)
at EdgeDriverTest.UnitTest1.TestMethod1()
I gave a try using the latest version of Edge WebDriver but no luck. Is there a way to get more informative message?

Related

webdriverIO ERROR webdriver: unknown error: Illegal key values seen in w3c capabilities: [args]

when executing : npx run wdio ./wdio.conf.js
i get this error :
0-0] 2022-12-14T15:29:29.651Z ERROR webdriver: unknown error: Illegal key values seen in w3c capabilities: [args]
at Object.getErrorFromResponseBody (/home/dodo/Desktop/PlateRate-Tester/node_modules/webdriver/build/utils.js:94:12)
at WebDriverRequest._request (/home/dodo/Desktop/PlateRate-Tester/node_modules/webdriver/build/request.js:134:31)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at Object.startWebDriverSession (/home/dodo/Desktop/PlateRate-Tester/node_modules/webdriver/build/utils.js:29:20)
at Function.newSession (/home/dodo/Desktop/PlateRate-Tester/node_modules/webdriver/build/index.js:35:45)
at Object.exports.remote (/home/dodo/Desktop/PlateRate-Tester/node_modules/webdriverio/build/index.js:53:22)
at Runner._startSession (/home/dodo/Desktop/PlateRate-Tester/node_modules/#wdio/runner/build/index.js:123:56)
at Runner._initSession (/home/dodo/Desktop/PlateRate-Tester/node_modules/#wdio/runner/build/index.js:103:25)
at Runner.run (/home/dodo/Desktop/PlateRate-Tester/node_modules/#wdio/runner/build/index.js:52:19)
[0-0] 2022-12-14T15:29:29.652Z ERROR #wdio/runner: Error: Failed to create session.
Illegal key values seen in w3c capabilities: [args]
Make sure to add vendor prefix like "goog:", "appium:", "moz:", etc to non W3C capabilities.
See more https://www.w3.org/TR/webdriver/#capabilities

FirefoxDriver Cannot start the driver service

Have an app that has been running without issue (or so Ive been told) for months, but as of a few weeks ago started failing. Looking at the logs, I see a lot of these errors
EXCEPTION: Error intializing Firefox driver. Error message: 'Cannot
start the driver service on http://localhost:52022/';
WebDriverException stack: 'OpenQA.Selenium.WebDriverException: Cannot
start the driver service on http://localhost:52022/ at
OpenQA.Selenium.DriverService.Start() at
OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command
commandToExecute) at
OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String
driverCommandToExecute, Dictionary`2 parameters) at
OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities
desiredCapabilities) at
OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor
commandExecutor, ICapabilities desiredCapabilities) at ... ... .
The project is a console app that is using the Selenium project to try to connect to an external website but it seems it is having trouble just starting up. The code where this exception is caught is below.
this._logger = logger;
this._processLog = new List<string>();
FirefoxProfile profile = null;
FirefoxOptions options = null;
profile = new FirefoxProfile();
profile.SetPreference("browser.download.folderList", 2);
profile.SetPreference("browser.download.dir", downloadPath);
profile.SetPreference("browser.download.manager.alertOnEXEOpen", false);
profile.SetPreference("browser.download.manager.focusWhenStarting", false);
profile.SetPreference("browser.download.manager.closeWhenDone", true);
profile.SetPreference("browser.download.manager.showAlertOnComplete", false);
profile.SetPreference("browser.helperApps.alwaysAsk.force", false);
profile.SetPreference("browser.helperApps.neverAsk.saveToDisk", "application/json,text/csv");
profile.SetPreference("browser.download.manager.useWindow", false);
profile.SetPreference("browser.download.panel.shown", false);
options = new FirefoxOptions();
options.AddArguments("-headless");
options.AddArgument("no-sandbox");
options.Profile = profile;
try
{
this._driver = new FirefoxDriver(driverPath, options, TimeSpan.FromSeconds(180));
}
catch (WebDriverException ex)
{
string message = string.Format("Error intializing Firefox driver. Error message: '{0}'; WebDriverException stack: '{1}' ",
ex.Message, ex.ToString());
result.ProcessLog.Add(new LogMessage(LogLevel.EXCEPTION, message));
throw ex;
}
catch(Exception ex)
{
string message = string.Format("Error intializing Firefox driver. Error message: '{0}'; Exception stack: '{1}' ",
ex.Message, ex.ToString());
result.ProcessLog.Add(new LogMessage(LogLevel.EXCEPTION, message));
throw ex;
}
The computer where this process runs has the latest version of Firefox installed, however, the FireFox Selenium driver looks dated. Could there be a dependency issue?

VB.net Microsoft.SqlServer.SqlClrProvider Error On client PC

I'm Using Visual Studio Ultimate 2012 and .net framwork 4.5.1
when i Publish my solution and install on client PC its showing me Error for Microsoft.SqlServer.SqlClrProvider missing... I also Included the Microsoft.SqlServer.SqlClrProvider in Published Files.
And if i'm installing in my own pc its Showing me error "Application cannot be Started. Contact the Application Vendor" Here is the Details of the Error.
PLATFORM VERSION INFO
Windows : 6.1.7601.65536 (Win32NT)
Common Language Runtime : 4.0.30319.42000
System.Deployment.dll : 4.6.1087.0 built by: NETFXREL4STAGE
clr.dll : 4.6.1087.0 built by: NETFXREL4STAGE
dfdll.dll : 4.6.1087.0 built by: NETFXREL4STAGE
dfshim.dll : 4.0.41209.0 (Main.041209-0000)
SOURCES
Deployment url : file:///D:/Publish/test/Inventory.application
IDENTITIES
Deployment Identity : Inventory.application, Version=0.9.0.88, Culture=neutral, PublicKeyToken=953af74a0fd8ab19, processorArchitecture=x86
APPLICATION SUMMARY
* Installable application.
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of D:\Publish\test\Inventory.application resulted in exception. Following failure messages were detected:
+ Value does not fall within the expected range.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [13-03-17 1:01:10 PM] : Activation of D:\Publish\test\Inventory.application has started.
* [13-03-17 1:01:11 PM] : Processing of deployment manifest has successfully completed.
ERROR DETAILS
Following errors were detected during this operation.
* [13-03-17 1:01:11 PM] System.ArgumentException
- Value does not fall within the expected range.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.NativeMethods.CorLaunchApplication(UInt32 hostType, String applicationFullName, Int32 manifestPathsCount, String[] manifestPaths, Int32 activationDataCount, String[] activationData, PROCESS_INFORMATION processInformation)
at System.Deployment.Application.ComponentStore.ActivateApplication(DefinitionAppId appId, String activationParameter, Boolean useActivationParameter)
at System.Deployment.Application.SubscriptionStore.ActivateApplication(DefinitionAppId appId, String activationParameter, Boolean useActivationParameter)
at System.Deployment.Application.ApplicationActivator.Activate(DefinitionAppId appId, AssemblyManifest appManifest, String activationParameter, Boolean useActivationParameter)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
COMPONENT STORE TRANSACTION DETAILS
* Transaction at [13-03-17 1:01:11 PM]
+ System.Deployment.Internal.Isolation.StoreOperationSetDeploymentMetadata
- Status: Set
- HRESULT: 0x0
+ System.Deployment.Internal.Isolation.StoreTransactionOperationType (27)
- HRESULT: 0x0
And Sorry For My English

Webdriver exception: "chrome not reachable"

I am running selenium test cases in a ubuntu server which basically runs testcases in both firefox and chrome.
Firefox launches and test cases run successfully but chrome throws exception:
*****below is the snippet of the stacktrace:*****
Starting ChromeDriver (v2.8.240825) on port 21549
PAC support disabled because there is no system implementation
Test IntegrationTest.AdminUserelementscheck failed:
org.openqa.selenium.WebDriverException: chrome not reachable
(Driver info: chromedriver=2.8.240825,platform=Linux 2.6.32-431.el6.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
[error] Command duration or timeout: 20.83 seconds
Hi Below is the small snippet of my code :
public class IntegrationTest {
private static final String configFile="test.properties";
private final String FIREFOX="firefox";
private final String CHROME="chrome";
private final String PHANTOMJS="phantomjs";
private final String BROWSERNAME="browser";
private static Properties props = new Properties();
public WebDriver webDriver;
private static Configuration additionalConfigurations;
#BeforeClass
public static void setUp() throws IOException, SQLException{
props.load(IntegrationTest.class.getResourceAsStream("/" + configFile));
}
#test
public void AdminUserelementscheck() throws SQLException, IOException {
String[] browsers = props.getProperty(BROWSERNAME).split(",");
System.out.println("Number of browsers specified in conf:"+props.getProperty(BROWSERNAME));
for(String browser:browsers){
System.out.println("Browser currently processing:"+browser);
if(browser.equalsIgnoreCase(FIREFOX))
webDriver = new FirefoxDriver();
else if(browser.equalsIgnoreCase(CHROME))
webDriver = new ChromeDriver();
else
webDriver = new PhantomJSDriver();
running(testServer(3333,fakeApplication()),webDriver, new Callback<TestBrowser>() {
********* LOGIN AND ASSERTION STATMENTS*******************
browser.quit()
}
});
}
This would be because Chrome is also making use of unix containers in order to run. If you want this to run within docker, pass the docker run command
--privileged
Otherwise you can start Chrome with
--no-sandbox
I have encoutered similar problem. I am running my Selenium tests locally and "webdriver exception chrome not reachable" error suddenly showed up.
The problem was that I already had too much tabs in my regular chrome browser. After getting frustrated I have closed few tabs and suddenly it worked. I am not sure if there is a certain limit of tabs, but if somebody encounters same problem, give it a try.
Your chrome driver seems to be old. Try downloading latest as of date from below and report back if you get any new errors.
http://chromedriver.storage.googleapis.com/index.html?path=2.14/
Also ensure that PATH environment variable has the path to chromedriver.

RESTEasy - Stacktrace in logs when throwing WebApplicationException

I am using Resteasy 2.3.3, bundled with JBoss-AS-7.1.3. I'm trying to
throw a new WebAppliationException, and the output (to the client) seems
fine, but I'm left with an unwanted stack trace in my log. I have a few
other Exceptions mapped, and I was wondering if the mapping was somehow
causing an issue ­ trying to wrap this Exception.
Simple example:
public class SimpleService {
#GET
#Path("stuff")
public String getStuff(final #QueryParam("param1") String param1,
#QueryParam("param2") String param2) throws ActionException {
if (param1==null && param2==null) {
throw new WebApplicationException();
}
I get the following exception:
[WARN] org.jboss.resteasy.core.SynchronousDispatcher#error - failed to execute: javax.ws.rs.WebApplicationException
Any ideas what this error might mean? How I could get rid of the messages?
I stumbled across another class in the javadoc - NoLogWebApplicationException, and it says:
WebApplicationExceptions are logged by RESTEasy. Use this exception
when you don't want your exception logged
https://docs.jboss.org/resteasy/docs/2.3.3.Final/javadocs/org/jboss/resteasy/spi/NoLogWebApplicationException.html

Resources