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

type 'canopy.classic' not found in assembly 'canopy, Version=2.0.0.0, #473

Closed OnurGumus closed 4 years ago

OnurGumus commented 5 years ago

I have the following fsharp script file:

#r "packages/Selenium.WebDriver/lib/netstandard2.0/WebDriver.dll"
#r "packages/canopy/lib/netstandard2.0/canopy.dll"

//these are similar to C# using statements
open canopy.runner.classic
open canopy.classic

canopy.configuration.chromeDir <- System.AppContext.BaseDirectory

//start an instance of chrome
start chrome

//this is how you define a test
"taking canopy for a spin" &&& fun _ ->
    //this is an F# function body, it's whitespace enforced

    //go to url
    url "http://lefthandedgoat.github.io/canopy/testpages/"

    //assert that the element with an id of 'welcome' has
    //the text 'Welcome'
    "#welcome" == "Welcome"

    //assert that the element with an id of 'firstName' has the value 'John'
    "#firstName" == "John"

    //change the value of element with
    //an id of 'firstName' to 'Something Else'
    "#firstName" << "Something Else"

    //verify another element's value, click a button,
    //verify the element is updated
    "#button_clicked" == "button not clicked"
    click "#button"
    "#button_clicked" == "button clicked"

//run all tests
run()

printfn "press [enter] to exit"
System.Console.ReadLine() |> ignore

quit()

I have installed canopy from nuget and when I run above with dotnet fsi that comes with .net core 3.0 I get the following


dotnet fsi .\test.fsx

error FS3216: type 'canopy.classic' not found in assembly 'canopy, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'. A possible cause may be a version incompatibility. You may 
need to explicitly reference the correct version of this assembly to allow all referenced components to use the correct version.
lefthandedgoat commented 5 years ago

I haven't used .net core 3.0 and I rarely use fsi, so off the top of my head I do not know.

If you can provide more information, like OS and IDE+version I may be able to reproduce and figure it out.

OnurGumus commented 5 years ago

It is Windows 10 pro 64 bit latest rtm. I use vs code, but it doesn't matter since I run dotnet fsi from command line

lefthandedgoat commented 5 years ago

Ok I am getting my VM up to date and I will give it a shot

lefthandedgoat commented 5 years ago

I was able to reproduce this, but after doing some reading I don't think there is a fix that you or I can do/use just yet.

You can read some here where MS/F# people discuss it: https://github.com/dotnet/fsharp/issues/3309

Sorry =(

kaeedo commented 4 years ago

I can confirm that the workaround from that issue works when using .Net Core 3 preview 9 on Windows 10

OnurGumus commented 4 years ago

right now it works out of box with .net core 3.1. Cheers!