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

Use MicrosoftEdge as a browserName #67

Open
thasso opened this issue Feb 27, 2024 · 1 comment
Open

Use MicrosoftEdge as a browserName #67

thasso opened this issue Feb 27, 2024 · 1 comment
Labels
priority: P3 Useful but not urgent type: enhancement New feature or request
Milestone

Comments

@thasso
Copy link

thasso commented Feb 27, 2024

We were experiencing a problem for a while now where the driver was complaining about not being able to find the msedge binary. I am not entirely sure with which driver/browser version it started, but at least for v122 I can confirm that the setting browserName to "MicrosoftEdge" fixes the problem.

Here is the error message I got from karma before:

{"value":{"error":"unknown error","message":"unknown error: cannot find msedge binary","stacktrace":"\\tGetHandleVerifier [0x00007FF71D5D5D42+55138]\\n\\tMicrosoft::Applications::Events::ILogConfiguration::operator* [0x00007FF71D5621C2+219010]\\n\\t(No symbol) [0x00007FF71D393407]\\n\\t(No symbol) [0x00007FF71D3C3A0C]\\n\\t(No symbol) [0x00007FF71D3C1511]\\n\\t(No symbol) [0x00007FF71D402D77]\\n\\t(No symbol) [0x00007FF71D3F8A73]\\n\\t(No symbol) [0x00007FF71D3CE53E]\\n\\t(No symbol) [0x00007FF71D3CD6FC]\\n\\t(No symbol) [0x00007FF71D3CE0F1]\\n\\tMicrosoft::Applications::Events::EventProperty::to_string [0x00007FF71D78ED2C+1067068]\\n\\t(No symbol) [0x00007FF71D4433C6]\\n\\t(No symbol) [0x00007FF71D4DCFAC]\\n\\t(No symbol) [0x00007FF71D4D4978]\\n\\tMicrosoft::Applications::Events::EventProperty::to_string [0x00007FF71D78DC75+1062789]\\n\\tMicrosoft::Applications::Events::ILogConfiguration::operator* [0x00007FF71D56BBB1+258417]\\n\\tMicrosoft::Applications::Events::ILogConfiguration::operator* [0x00007FF71D566AB4+237684]\\n\\tMicrosoft::Applications::Events::ILogConfiguration::operator* [0x00007FF71D566BEF+237999]\\n\\tMicrosoft::Applications::Events::ILogConfiguration::operator* [0x00007FF71D55D6A1+199777]\\n\\tBaseThreadInitThunk [0x00007FFDF0087344+20]\\n\\tRtlUserThreadStart [0x00007FFDF13A26B1+33]\\n"}}

Here is the configuration that we are using right now, which overwrites the browser name and seems to fix the issue:

'Edge_Local': {
  base: 'Edge',
  config: {
    browserName: "MicrosoftEdge",
  },
},

I think the problem is at the location linked below and it might be just a matter of changing the browser name there. I would have opened a PR, but I am not sure and can not verify if a change like that would break older versions.

const LocalWebDriverEdge = generateSubclass(
'MSEdge', 'MSEdge',
'msedgedriver',
(port) => ['--port=' + port],
edgeOptions);

@joeyparrish
Copy link
Member

Edge is an evergreen browser, and I don't care about older versions.

Would your change remove the need for this section?

// If a binary is found with the name "microsoft-edge" in the PATH, specify
// that explicitly. This works around the following edgedriver bug:
// https://github.com/MicrosoftEdge/EdgeWebDriver/issues/102#issuecomment-1710724173
const edgeOptions = {};
let edgeBinary = which.sync('microsoft-edge', {nothrow: true});
if (!edgeBinary) {
// Since v120 or v121, msedgedriver always fails if you do not specify the
// Edge binary path. Assume some platform-specific defaults. Only use these
// paths if they exist.
switch (os.platform()) {
case 'darwin':
edgeBinary = '/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge';
break;
case 'win32':
edgeBinary = 'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe';
break;
case 'linux':
edgeBinary = '/opt/microsoft/msedge/microsoft-edge';
break;
}
// If that platform-specific binary doesn't exist, don't try to use it.
if (edgeBinary && !fs.existsSync(edgeBinary)) {
edgeBinary = null;
}
}
if (edgeBinary) {
edgeOptions['ms:edgeOptions'] = {
binary: edgeBinary,
};
}

Please send a PR! I will be glad to test it in the Shaka lab on all three platforms.

@joeyparrish joeyparrish added type: enhancement New feature or request priority: P3 Useful but not urgent labels Mar 11, 2024
@github-actions github-actions bot added this to the Backlog milestone Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: P3 Useful but not urgent type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants