Skip to content

[🐛 Bug]: Unable to obtain Selenium Manager Binary #13077

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

Closed
dammie12 opened this issue Nov 1, 2023 · 10 comments
Closed

[🐛 Bug]: Unable to obtain Selenium Manager Binary #13077

dammie12 opened this issue Nov 1, 2023 · 10 comments
Labels
I-defect Something is not working as intended J-awaiting answer Question asked of user; a reply moves it to triage again

Comments

@dammie12
Copy link

dammie12 commented Nov 1, 2023

What happened?

While running my test, i do get this message and when it pops up, all the remaining tests fails from that point. I mean, sometimes, it runs for over 30mins before encountering this issue. Unfortunately, it happens anywhere in the list of test. I happen to have about 30 testcases in the suite.

error Unable to obtain Selenium Manager Binary at: C:\Users\USER~1\AppData\Local\Temp\selenium-manager13842424259427006952094714289847755\selenium-manager.exe
Build info: version: '4.14.1', revision: '03f8ede370'
System info: os.name: 'Windows Server 2019', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.8'
Driver info: driver.version: EdgeDriver

After this error shows up, finding elements results in this error - Cannot invoke "org.openqa.selenium.SearchContext.findElement(org.openqa.selenium.By)" because "this.searchContext" is null

How can we reproduce the issue?

try {
		this.driver = BrowserFactory.getDriver(browserName);//BrowserFactory retu
		this.driver.manage().timeouts().implicitlyWait(Duration.ofMillis(10000));
		this.elementWait = new WebDriverWait(this.driver, waitTimeOut);
		this.driver.manage().deleteAllCookies();
		Methods.pause(5);
		this.driver.get(baseURL);
		Entry.logs.info("Setting up driver");

		/* Tries to reset browser zoom to default - 100% */
		this.driver.manage().window().maximize();
		this.driver.findElement(By.tagName("html")).sendKeys(Keys.chord(Keys.CONTROL, "0"));
	} catch (Exception e) {
		ResultLog.testFail(e.getMessage());
	}

WebDriver getDriver(String browser) {
	WebDriver driver;
	if (browser.toLowerCase().equalsIgnoreCase("chrome")) {
		ChromeOptions chromeOptions = new ChromeOptions();
		chromeOptions.addArguments("--remote-allow-origins=*", "ignore-certificate-errors");
		driver = new ChromeDriver(chromeOptions);
	} else {
		EdgeOptions edgeOptions = new EdgeOptions();
		edgeOptions.addArguments("--remote-allow-origins=*", "ignore-certificate-errors");
		driver = new EdgeDriver(edgeOptions);
	}
	return driver;
}

Relevant log output

error Unable to obtain Selenium Manager Binary at: C:\Users\DOLUBA~1\AppData\Local\Temp\selenium-manager13842424259427006952094714289847755\selenium-manager.exe
Build info: version: '4.14.1', revision: '03f8ede370'
System info: os.name: 'Windows Server 2019', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.8'
Driver info: driver.version: EdgeDriver

After this error shows up, finding elements results in this error - Cannot invoke "org.openqa.selenium.SearchContext.findElement(org.openqa.selenium.By)" because "this.searchContext" is null

Operating System

Windows 11 Pro

Selenium version

4.14.1

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

Chrome 118

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

ChromeDriver 118.0.5993.70, msedgedriver 118.0.2088.76

Are you using Selenium Grid?

No response

@dammie12 dammie12 added I-defect Something is not working as intended A-needs-triaging A Selenium member will evaluate this soon! labels Nov 1, 2023
Copy link

github-actions bot commented Nov 1, 2023

@dammie12, 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!

@diemol
Copy link
Member

diemol commented Nov 6, 2023

@bonigarcia do you remember what this error was?

@diemol diemol added J-awaiting answer Question asked of user; a reply moves it to triage again and removed A-needs-triaging A Selenium member will evaluate this soon! labels Nov 6, 2023
@bonigarcia
Copy link
Member

@diemol Sorry, I don't see any relevant log of the Rust side here. The message "this.searchContext" is null seems related to Java.

@dammie12 I would do the following:

  1. Bump to Selenium 4.15.0
  2. Capture the Selenium Manager logs. See logging doc. See example.

@diemol
Copy link
Member

diemol commented Nov 6, 2023

I meant the unable to find Selenium Manager binary message

@titusfortner
Copy link
Member

titusfortner commented Nov 6, 2023

I think it was getting deleted from temp directory after a time somehow. The saving the binary to cache directory in 4.15 should be the fix.

@NagaLakshmiE
Copy link

NagaLakshmiE commented Nov 13, 2023

Getting the same exception using Selenium Manager 4.15.0 version with CSharp automation. On few machines it is working fine but on few it is failing with the above exception.

@titusfortner
Copy link
Member

This issue was specific to Java and fixed in 4.15. If there is a different issue, please open a new ticket. Thank you.

@dammie12
Copy link
Author

Thanks Titus, upgrading to 4.15 resolved the issue. I noticed that the selenium manager exe file is created in the cache. I assume that every upgrade to selenium would generate its own folder, correct?

@titusfortner
Copy link
Member

every upgrade to selenium would generate its own folder

Yes, we want to make sure we are keeping functionality correct for the versions without needing to figure out backwards compatibility while this feature is still in beta.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I-defect Something is not working as intended J-awaiting answer Question asked of user; a reply moves it to triage again
Projects
None yet
Development

No branches or pull requests

5 participants