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

Not able to execute canopy script on Edge Browser #522

Open
RutujaNagare opened this issue Jul 29, 2021 · 3 comments
Open

Not able to execute canopy script on Edge Browser #522

RutujaNagare opened this issue Jul 29, 2021 · 3 comments

Comments

@RutujaNagare
Copy link

Describe the bug
I am trying to execute canopy script on Edge Browser but my script is not able to execute. Edge browser is opening at the time of execution but the given URL is not entering on browser. So that next flow of test case is not working.

I am using below code to open Edge Browser and entering URL in it, using this code Edge browser is opening but not able to enter URL
let OpenEdgeBrowser(givenUrl) =
start EdgeBETA
pin types.Left
url givenUrl

If I use below code then Edge browser itself is not opening
let OpenEdgeBrowser(givenUrl) =
browser <- new EdgeDriver()
url givenUrl

Also Nuget Package related to Edge browser is installed and a edge driver is also placed at given location in code (C drive)
EdgeBrowserIssue

Could you please suggest solution?

@lefthandedgoat
Copy link
Owner

I downloaded the edge driver from here: https://msedgedriver.azureedge.net/92.0.902.55/edgedriver_win64.zip

Unzip the exe, placed it in c:\ (you can place wherever), renamed to MicrosoftWebDriver.exe and everything worked.

open canopy.runner.classic
open canopy.classic
open canopy.types

canopy.configuration.edgeDir <- @"C:\" // change to where you put your driver

context "something"
    
//start an instance of chrome
start EdgeBETA

//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()

@RutujaNagare
Copy link
Author

Hi,

I tried as per given instruction. Downloaded Edge Drive and placed at correct location. But no luck this time as well.

Edge browser is opening but given URL is not entered.

Getting below error message on result
EdgeBrowserIssue1

@lefthandedgoat
Copy link
Owner

Does this same set of code you are writing work with other browsers?

You will have to share more code than this. That error message is because the browser is null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants