SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
29.77k stars 8.02k forks source link

Not able initiate browser in remote system whereas it's working fine in local system[🐛 Bug]: #14204

Open ravikiranreddy6295 opened 5 days ago

ravikiranreddy6295 commented 5 days ago

What happened?

I tried to use beta version of Chrome for testing, it is not initiating the browser. Alternatively I am using chromeOptions.setbinary("C:\Program Files\chrome-win64\chrome-win64\chrome.exe"), it is working in local but not in remote system.(downloaded stable CFT version as beta was not working)

How can we reproduce the issue?

case "chrome":

                ChromeOptions chromeOptions = new ChromeOptions();
                chromeOptions.setBinary("C:\\Program Files\\chrome-win64\\chrome-win64\\chrome.exe");
                //chromeOptions.setBrowserVersion("beta");

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

                if (browserMode.equalsIgnoreCase("headless")) {
                    chromeOptions.addArguments("--headless");
                }
                chromeOptions.setExperimentalOption("excludeSwitches",
                        Arrays.asList("--disable-popup-blocking"));

                tlDriver.set(new ChromeDriver(chromeOptions));
break;

Relevant log output

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. 
Host info: host: 
Build info: version: '4.22.0', revision: 'c5f3146703*'
System info: os.name: 'Windows Server 2019', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.9'
Driver info: org.openqa.selenium.chrome.ChromeDriver

Operating System

Windows 10

Selenium version

selenium 4.22.0

What are the browser(s) and version(s) where you see this issue?

Chrome 126.0.6478.127

What are the browser driver(s) and version(s) where you see this issue?

Chrome driver 126.0.6478.126

Are you using Selenium Grid?

No

github-actions[bot] commented 5 days ago

@ravikiranreddy6295, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

github-actions[bot] commented 5 days ago

We need more information about this issue in order to troubleshoot.

Please turn on logging and re-run your code. Information on how to adjust logs for your language can be found in our Troubleshooting documentation.

github-actions[bot] commented 5 days ago

Hi, @ravikiranreddy6295. Please follow the issue template, we need more information to reproduce the issue.

Either a complete code snippet and URL/HTML (if more than one file is needed, provide a GitHub repo and instructions to run the code), the specific versions used, or a more detailed description to help us understand the issue.

Note: If you cannot share your code and URL/HTML, any complete code snippet and URL/HTML that reproduces the issue is good enough.

Reply to this issue when all information is provided, thank you.

titusfortner commented 5 days ago

The issue is for a remote session it requires matching the browser version. Unless you have specified "beta" in a stereotype, this will fail. I added a line of code to exempt "stable" from this requirement. @diemol should we do the same with "beta?"

diemol commented 5 days ago

I'd love to see the logs to double check it, but sure.

titusfortner commented 5 days ago

Hmm, isn't this the error when you don't get matching capabilities?

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

But you're right, complete logs would let us know for sure this is the problem..