lefthandedgoat / canopy

f# web automation and testing library, built on top of Selenium (friendly to c# also)
http://lefthandedgoat.github.io/canopy/
MIT License
506 stars 115 forks source link

Microsoft WebDriver support #454

Closed eugene-g closed 5 years ago

eugene-g commented 5 years ago

Hello,

Can anybody confirm that canopy works with MS Edge driver (17134)? Getting The remote server returned an error: (400) Bad Request. with the most recent Windows. Not sure if the problem is with canopy or with the webdriver.

lefthandedgoat commented 5 years ago

@eugene-g

Using Edge: Microsoft Edge 41.16299.371.0 Microsoft EdgeHTML 16.16299

Driver: Release 16299 Version: 5.16299 | Edge version supported: 16.16299

This works for me:

configuration.driverHostName <- "localhost"
start edgeBETA

Windows 10, .net461

I am trying to get my VM updated to latest so I can have the same version as you and test that.

lefthandedgoat commented 5 years ago

Using Windows 10, .net core Microsoft Edge 42.17134.1.0 Microsoft EdgeHTML 17.17134

Driver: Release 17134 Version: 6.17134 | Edge version supported: 17.17134

The browser launches and runs a basic test.

configuration.driverHostName <- "localhost"
start edgeBETA
eugene-g commented 5 years ago

configuration.driverHostName <- "localhost"

This line solves the issue. What does it mean?

Since Chrome and Firefox tests were working fine, I didn't even think that problem could be with canopy configuration.

btw, a few issues with project:

  1. Edge is not covered by basic tests
  2. In build.fsx: testAssemblies path is incorrect. I believe it should be something like "tests/**/bin/Release/**/*basictests*.dll"
  3. But even if you correct the path:
    Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
    Running build failed.
    Error:
    System.Exception: Failed result from basictests
    at FSI_0005.Build.clo@107-7.Invoke(String testFile)
    at Microsoft.FSharp.Collections.SeqModule.Iterate[T](FSharpFunc`2 action, IEnumerable`1 source)
    at FSI_0005.Build.clo@102-6.Invoke(Unit _arg5)
    at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in D:\code\fake\src\app\FakeLib\TargetHelper.fs:line 626

I gave up trying to fix that issue and did dotnet run to ensure that issue could be closed.

lefthandedgoat commented 5 years ago

For build.fsx, I can't remember if I use it anymore with .net core, so don't worry about that.

I added configuration.driverHostName <- "localhost" because in .net core it can't resolve localhost correctly and it made every call to selenium have an additional 1 second added to it, making tests crazy slow. That setting is used by selenium to know what address to talk to the webdriver over. http://127.0.0.1:19123 or http://localhost:19123. I set it to use 127.0.0.1 to make dotnet core work at the correct speed, but apparently that breaks edge.

eugene-g commented 5 years ago

Good thing about "localhost" is that it works with all major browsers (except Safari, haven't tried it yet). Speed issue is important though.

Thank you for your time and explanations.