0

Please find the Error Log Line :

ChromeDriver was started successfully.
Mar 14, 2023 12:13:48 PM org.openqa.selenium.remote.http.WebSocket$Listener onError
WARNING: Invalid Status code=403 text=Forbidden
java.io.IOException: Invalid Status code=403 text=Forbidden
    at org.asynchttpclient.netty.handler.WebSocketHandler.abort(WebSocketHandler.java:92)
    at org.asynchttpclient.netty.handler.WebSocketHandler.handleRead(WebSocketHandler.java:118)
    at org.asynchttpclient.netty.handler.AsyncHttpClientHandler.channelRead(AsyncHttpClientHandler.java:78)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
    at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:336)
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:323)
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:444)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:280)
    at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
    at io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:280)

Code for opening separate duplicate browser in different port address

public static void chromeSetup() {
    WebDriverManager.chromedriver().setup();
    ChromeOptions opt = new ChromeOptions();

    opt.setExperimentalOption("debuggerAddress", "localhost:9988");
    driver = new ChromeDriver(opt);
    
}

chromeSetup() is implemented in other methods and classes starting while trying to open url for eg:

      if (reportType.equals("Y") || reportType.equals("y")) {
            chromeSetup();
            driver.get("sample url");
            exportButton();

            mainKey();

        } else if (reportType.equals("N") || reportType.equals("n")) {

            mainKey();

        }
2
  • Does this answer your question? java.io.IOException: Invalid Status code=403 text=Forbidden Commented Mar 14, 2023 at 8:04
  • @RolandasUlevicius yes it works only if i don't want to run on separate browser instance, but it throws same error while trying to run on separate browser instance which is running on localhost:9988. Commented Mar 14, 2023 at 9:12

1 Answer 1

3

You just need to add this option and it will work

options.addArguments("--remote-allow-origins=*");

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.