SeleniumHQ / selenium-ide

Open Source record and playback test automation for the web.
https://selenium.dev/selenium-ide/
Apache License 2.0
2.79k stars 758 forks source link

Not able to run tests with selenium-side-runner on Edge #796

Open clemathis opened 5 years ago

clemathis commented 5 years ago

🐛 Bug Report

Preconditons:

Edge driver is installed. Path to edge driver is defined.

Steps to reproduce the behavior:

  1. Run command: selenium-side-runner -c "browserName=edge" suit_name.side

Result is:

Test suite failed to run
Do not know how to build driver: edge; did you forget to call usingServer(url)?

      at Builder.build (../AppData/Roaming/npm/node_modules/selenium-side-runner/node_modules/selenium-webdriver/index.js:692:15)
      at buildDriver (../AppData/Roaming/npm/node_modules/selenium-side-runner/node_modules/jest-environment-selenium/dist/index.js:66:17)
      at WebdriverEnvironment.setup (../AppData/Roaming/npm/node_modules/selenium-side-runner/node_modules/jest-environment-selenium/dist/index.js:37:32)

I've tried also to run selenium server locally and point it in the command: selenium-side-runner -c "browserName=edge" -s 0.0.0.0:4444 suit_name.side Result that I received for that was: ` ● Test suite failed to run

TypeError: Cannot read property 'endsWith' of null

  at HttpClient.send (../AppData/Roaming/npm/node_modules/selenium-side-runner/node_modules/selenium-webdriver/http/index.js:121:14)
  at Executor.execute (../AppData/Roaming/npm/node_modules/selenium-side-runner/node_modules/selenium-webdriver/lib/http.js:482:33)`

Expected behavior

Test suite will be running, same as for other browser drivers (like for Chrome).

Environment

OS: Windows 10 Pro Selenium IDE Version: 3.12.3 Selenium SIDE Runner Version: 3.12.1 Node version: 10.13.0 Browser: Microsoft Edge Browser Version: 44.18362.1.0 (64-bit)

corevo commented 5 years ago

I wonder if we can get around to getting a windows CI going to test edge, atm I'll have to set up a vm and manually check it out.

marknoble commented 4 years ago

I'm observing similar behavior trying to get Edge (Chromium) working with the webdrivers found here: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/

Maybe we should add an "Edge Chromium" option for this as a browser name?

In my case, I was using browser version: 80.0.361.9 (Official build) dev (64-bit)

I was noticing a similar message to the Edge message posted above.

Wolvester commented 4 years ago

I'm having the same issue with Edge.

I've managed to get around it by running the Edge webdriver on its own and pointing to it in the command.

So, with the webdriver listening on http://localhost:17556/ the command is selenium-side-runner -c "browserName=edge" -s http://localhost:17556/ suit_name.side

clfordhub commented 2 years ago

I have been having the same issue with this. I found if I update my browser name to MicrosoftEdge, it doesn't give this error: Do not know how to build driver: edge; did you forget to call usingServer(url)?

However, it gives this error instead: The MicrosoftWebDriver.exe could not be found on the current PATH. Please download the latest version of the MicrosoftEdgeDriver from https://www.microsoft.com/en-us/download/details.aspx?id=48212 and ensure it can be found on your PATH.

I've searched and searched, but have not found a solution for this. I have edgdriver and msedgedriver installed. Renamed msedgedriver to MicrosoftWebDriver, all return the same error. Is Edge compatible with v3 side runner? I've tried switching to v4, but that hasn't worked for me at all in Windows 10.

toddtarsi commented 2 years ago

@clfordhub - Have you tried opening two pshell tabs and running the edgedriver in one tab and using the command in the comment above?

clfordhub commented 2 years ago

Hey, @toddtarsi I'm not able to run edgedriver, but I can successfully start msedgedriver. It's not looking for it in the path I expected, but I copied the files to the path it showed, and then it did start. I tried my side file again, but it was still asking for MicrosoftWebDriver.exe. What is displayed in my folder path is msedgedriver, so not quite sure what it's looking for or why it's not looking in the path I have specified in PS.

side note (I'm attempting this on v3 using node v14, but v4 and node v16 return the same) Something wrong with the path or naming still, just not sure what.

toddtarsi commented 2 years ago

@clfordhub - Shoot, I was hoping if msedgedriver or edgedriver was running in a separate tab, it wouldn't have to worry about finding it on the path at all and just go right into building / running because some like ping style thing comes back or something. Dang! Well, sorry to be unable to help more with this. It might be worth it to use v3 or v4 of the selenium-webdriver directly and work backwards from that:

https://www.npmjs.com/package/selenium-webdriver

I think the IDE is obfuscating your problems down here, and if you can figure out how to get started here, you'll probably be able to bring what you learn back up into either version of the side-runner.

toddtarsi commented 2 years ago

@clfordhub - To give some context, the error you're getting is coming back from this package, which are the JS bindings for the webdriver protocol. It's coming from when we build your driver using the "Builder API"

toddtarsi commented 2 years ago

@clfordhub - Also also last response, if you can get to being stuck on just selenium-webdriver, and you reach out in the main selenium channel on Slack, you'll get help from some people who are way more capable than I am, which is another good reason to go that way.

clfordhub commented 2 years ago

Thanks! @toddtarsi It's very specific to MS Edge. FireFox and Chrome work fine in side runner and IDE. Edge IDE works fine too in IDE. It's just side runner that isn't cooperating with Edge. I used npm install to get edgedriver and msedgedriver, and let it do it's thing. I'll check Slack too.

doikota commented 2 years ago

Great thanks to the WA comment of Wolvester on 13 Mar 2020. For my case, I had to specify browserName as MicrosoftEdge instead of edge, hence I typed my command in following manner.

selenium-side-runner -c "browserName=MicrosoftEdge" -s http://localhost:17556 suit_name.side

Note) you can simply start up your msedgedriver.exe by just double clicking it. Then the console starts up and it gives you the driver version and listening port number.

My Edge version: 105.0.1343.33 My msedgedriver.exe version: 105.0.1343.33

clfordhub commented 2 years ago

Thanks, @doikota. In addition to typing the browser as "MicrosoftEdge", in order to get mine to work, I also had to change this:

Change the code on: ../../../../../node_modules_for_selenium/node_modules/selenium-side-runner/node_modules/selenium-webdriver/edge.js Line 85 const EDGEDRIVER_EXE = 'MicrosoftWevDriver.exe'; to const EDGEDRIVER_EXE = 'msedgedriver.exe';