0
DesiredCapabilities capabillities = DesiredCapabilities.edge();
            capabillities.setBrowserName(BrowserType.EDGE); 
      
    capabillities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);     
    capabillities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);
        capabillities.setCapability(CapabilityType.SUPPORTS_JAVASCRIPT , true);
        capabillities.setPlatform(Platform.WIN10);  
        capabillities.setCapability(CapabilityType.BROWSER_VERSION, "latest");
        
        WebDriver driver = null;
        List<String> displayedList = new ArrayList<String>();
        
        
        try {
            System.out.println("STARTED");
            
            
            
            driver = new RemoteWebDriver(new URL("url"), capabillities);
            driver.get("https://url"); 
            
            System.out.println("OPENED");

I am getting the below Error:

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create session from {
  "desiredCapabilities": {
    "acceptSslCerts": true,
    "browserVersion": "latest",
    "browserName": "MicrosoftEdge",
    "javascriptEnabled": true,
    "ignoreProtectedModeSettings": true,
    "version": "",
    "platform": "WIN10"
  },
  "capabilities": {
    "firstMatch": [
      {
        "browserName": "MicrosoftEdge",
        "browserVersion": "latest",
        "platformName": "win10"
      }
    ]
  }
}
Build info: version: '3.141.0', revision: '2ecb7d9a', time: '2018-10-31T20:22:52'
System info: host: 'VDI-PR-E0042', ip: '10.93.173.183', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_171'
Driver info: driver.version: unknown
Command duration or timeout: 1.35 seconds
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
    at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53)
    at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)
    at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:122)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
    at java.base/java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
    at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
    at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
    at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:125)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:212)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:130)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:143)
    at Test.TestRemoteGrid.main(TestRemoteGrid.java:60)
2
  • If you need our help, you need to provide all information like error messages, "Not able to Launch Edge" can mean many different things.
    – pavelsaman
    May 25, 2021 at 11:43
  • have added if you could give inputs will be helpful
    – user49677
    May 25, 2021 at 11:59

1 Answer 1

0

I have done this in C# before (code below is C#) but it looks to be just about the same in Java.

// Create an options object to specify command line arguments for the Edge web driver
EdgeOptions options = new EdgeOptions();
// Use Remote Edge
try
{
    // Create a remote session using the Grid Hub URI (from the App.config)
    returnValue = new RemoteWebDriver(hubUri, options);
}
// Use Local Edge
catch
{
    // Write result to log
    Log.WriteLine("    [WARNING] Unable to create a remote session, so creating a local one.");
    // Create a local session
    returnValue = new EdgeDriver(options);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.