Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

winium not running it was running last month- error with invalid capabilities #366

Open
16seguro opened this issue Oct 31, 2023 · 0 comments

Comments

@16seguro
Copy link

16seguro commented Oct 31, 2023

Hello Winium team- Happy Halloween

I need help resolving the invalid capabilities issue. Thanks, below is the info:

This app was running last month, and this week I was trying to use it to continue with new functionality, but I am getting the error at execution:

  1. run the Winium.Desktop.Driver.exe
  2. run the code then I get the error
  3. Winium.Desktop.Driver.exe errors with FATAL] Failed to start driver: System.IndexOutOfRangeException: Index was outside the bounds of the array.
    ==================================================================
    error:
    IDE eclipse error:
    Oct 31, 2023 9:45:20 AM org.openqa.selenium.remote.RemoteWebDriver checkNonW3CCapabilities
    WARNING: Support for Legacy Capabilities is deprecated; You are sending the following invalid capabilities: [app]; Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
    Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
    Build info: version: '4.4.0', revision: 'e5c75ed026a'
    System info: host: 'DESKTOP-ERBFR99', ip: '192.168.56.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_211'
    Driver info: org.openqa.selenium.winium.WiniumDriver
    Command: [null, newSession {capabilities=[Capabilities {app: C:\Windows\System32\calc.exe}], desiredCapabilities=Capabilities {app: C:\Windows\System32\calc.exe}}]
    Capabilities {}
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:565)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:242)
    at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:157)
    at org.openqa.selenium.winium.WiniumDriver.(WiniumDriver.java:84)
    at com.joz.selenium.SeleniumFour.main(SeleniumFour.java:32)
    Caused by: java.io.UncheckedIOException: java.net.ConnectException: https://localhost:9999
    at org.openqa.selenium.remote.http.netty.NettyHttpHandler.makeCall(NettyHttpHandler.java:73)
    at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)
    at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:56)
    at org.openqa.selenium.remote.http.netty.NettyHttpHandler.execute(NettyHttpHandler.java:49)
    at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)
    at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:56)
    at org.openqa.selenium.remote.http.netty.NettyClient.execute(NettyClient.java:98)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:120)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:102)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:67)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)
    at org.openqa.selenium.winium.WiniumDriverCommandExecutor.execute(WiniumDriverCommandExecutor.java:78)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:547)
    ... 4 more
    Caused by: java.net.ConnectException: https://localhost:9999
    at org.asynchttpclient.netty.channel.NettyConnectListener.onFailure(NettyConnectListener.java:179)
    at org.asynchttpclient.netty.channel.NettyConnectListener$1.onFailure(NettyConnectListener.java:151)
    at org.asynchttpclient.netty.SimpleFutureListener.operationComplete(SimpleFutureListener.java:26)
    at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578)
    at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:571)
    at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:550)
    at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491)
    at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616)
    at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:609)
    at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:117)
    at io.netty.handler.ssl.SslHandler.setHandshakeFailure(SslHandler.java:1883)
    at io.netty.handler.ssl.SslHandler.channelInactive(SslHandler.java:1068)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:241)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1405)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248)
    at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:901)
    at io.netty.channel.AbstractChannel$AbstractUnsafe$7.run(AbstractChannel.java:813)
    at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.nio.channels.ClosedChannelException
    at io.netty.handler.ssl.SslHandler.channelInactive(SslHandler.java:1065)
    ... 16 more

Winium.Desktop.Driver.exe error:
Starting Windows Desktop Driver on port 9999

12:43:19 [FATAL] Failed to start driver: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Winium.Desktop.Driver.HttpRequest.ReadHeaders(TextReader textReader)
at Winium.Desktop.Driver.HttpRequest.ReadFromStreamWithoutClosing(Stream stream)
at Winium.Desktop.Driver.Listener.StartListening()
at Winium.Desktop.Driver.Program.Main(String[] args)

Unhandled Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Winium.Desktop.Driver.HttpRequest.ReadHeaders(TextReader textReader)
at Winium.Desktop.Driver.HttpRequest.ReadFromStreamWithoutClosing(Stream stream)
at Winium.Desktop.Driver.Listener.StartListening()
at Winium.Desktop.Driver.Program.Main(String[] args)


code:
package calc2;

import java.net.MalformedURLException;
import java.net.URL;

import org.openqa.selenium.By;
import org.openqa.selenium.winium.DesktopOptions;
import org.openqa.selenium.winium.WiniumDriver;

public class TestCalc2
{
public static void main(String args[]) throws MalformedURLException, InterruptedException
{
DesktopOptions options = new DesktopOptions();
options.setApplicationPath("C:\Windows\System32\calc.exe");
WiniumDriver driver = new WiniumDriver(new URL("http://localhost:9999"),options);
Thread.sleep(3000);
driver.findElementById("num8Button").click();
driver.findElementById("plusButton").click();
driver.findElementById("num9Button").click();
driver.findElementById("equalButton").click();
String output = driver.findElement(By.id("CalculatorResults")).getAttribute("Name");
System.out.println("Result:"+output);
//driver.findElementById("Close").click();
driver.quit();
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant