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

[🐛 Bug]: Builder.forBrowser(Browser.INTERNET_EXPLORER) not use selenium-manager #11579

Closed
cbl980226 opened this issue Jan 21, 2023 · 13 comments

Comments

@cbl980226
Copy link

cbl980226 commented Jan 21, 2023

What happened?

new Builder().forBrowser(Browser.INTERNET_EXPLORER).build()

not trying Selenium Manager

(seleniumManager.driverLocation)[https://github.com/SeleniumHQ/selenium/blob/634d19acf1274276f40533f4a1243adf2d1be8fb/javascript/node/selenium-webdriver/common/seleniumManager.js#L66] can't get ie driver location

How can we reproduce the issue?

mkdir tests
cd tests
npm init -y
npm add -D selenium-webdriver
touch webdriver.test.js
node webdriver.test.js

webdriver.test.js

const { Browser, Builder, By } = require('selenium-webdriver');

(async () => {
  // const driver = await new Builder().forBrowser(Browser.CHROME).build();
  const driver = await new Builder().forBrowser(Browser.INTERNET_EXPLORER).build();
  await driver.get('https://www.selenium.dev/selenium/web/web-form.html');
  const textBox = await driver.findElement(By.name('my-text'));
  const submitButton = await driver.findElement(By.css('button'));

  await textBox.sendKeys('Selenium');
  await submitButton.click();
  await driver.quit();
})();

Relevant log output

$ node webdriver.test.js
The IEDriverServer.exe executable could not be found on the current PATH,
trying Selenium Manager
Unable to obtain driver using Selenium Manager: Error: Unable to locate dr
iver associated with browser name: internet explorer

Operating System

Windows 10

Selenium version

Node selenium-webdriver@4.8.0

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

None

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

None

Are you using Selenium Grid?

No response

@github-actions
Copy link

@cbl980226, 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 Jan 23, 2023

Is this still happening with 4.8.0?

@cbl980226
Copy link
Author

Is this still happening with 4.8.0?

Yes, I tried it with 4.8.0 version using the example above , it still happens.

driverLocation(Browser.INTERNET_EXPLORER) not allowed

https://github.com/SeleniumHQ/selenium/blob/trunk/javascript/node/selenium-webdriver/ie.js#L409

  if (!exe) {
    console.log(
      `The ${IEDRIVER_EXE} executable could not be found on the current PATH, trying Selenium Manager`
    )

    try {
      exe = driverLocation(Browser.INTERNET_EXPLORER)
    } catch (err) {
      console.log(`Unable to obtain driver using Selenium Manager: ${err}`)
    }
  }

https://github.com/SeleniumHQ/selenium/blob/trunk/javascript/node/selenium-webdriver/common/seleniumManager.js#L65

/**
 * currently supported browsers for selenium-manager
 * @type {string[]}
 */
const Browser = ['chrome', 'firefox', 'edge']

function driverLocation(browser) {
  if (!Browser.includes(browser.toLocaleString())) {
    throw new Error(
      `Unable to locate driver associated with browser name: ${browser}`
    )
  }
 }

@diemol
Copy link
Member

diemol commented Jan 23, 2023

Are you behind a proxy?

@cbl980226
Copy link
Author

Are you behind a proxy?

Yes I use the clash proxy

@diemol
Copy link
Member

diemol commented Jan 23, 2023

OK, this is not supported yet. This PR implements it #11575, and we should be able to release in a couple of weeks.

@diemol diemol closed this as completed Jan 23, 2023
@cbl980226
Copy link
Author

@diemol
Copy link
Member

diemol commented Jan 23, 2023

@bonigarcia could you please help us to check this?

@diemol diemol reopened this Jan 23, 2023
@bonigarcia
Copy link
Member

I think the Selenium JavaScript binding should support IExplorer as well, since Selenium Manager already does. If I am not wrong, in this line:

https://github.com/SeleniumHQ/selenium/blob/trunk/javascript/node/selenium-webdriver/common/seleniumManager.js#L33

... it seems that the JavaScript binding does not supports IExplorer yet.

@diemol
Copy link
Member

diemol commented Jan 23, 2023

Good point. Thanks @bonigarcia!

@harsha509, is this a matter of adding iexplorer to that array?

@titusfortner
Copy link
Member

For next version of Selenium, we are hopefully moving to parsing the options instance for browser name and browser version and not using the driver name.

@harsha509
Copy link
Member

Looks like a diff issue, if IEDriver not found, JS binding send internet explorer to selenium-manager instead of iexplorer!

Fixed with above commit. tested in windows machine!

@harsha509
Copy link
Member

Good point. Thanks @bonigarcia!

@harsha509, is this a matter of adding iexplorer to that array?

Also, added iexplorer into array!

Thank you @diego, @titusfortner !

@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants