Search code examples
f#web-testingcanopy-web-testing

returning variables F#(canopy) easiest way


 member x.Logovani(window : string) =
            let weburl = ref ""   
            let actwindow = ref ""     

            "Login" &&& fun _ ->
                browser.SwitchTo().Window(window) |> ignore
                weburl := currentUrl()
                actwindow := browser.CurrentWindowHandle
                return {|weburl,actwindow|}
 end

Hello my question is how to pass weburl and actwindoweasiest way, because the way of my return is not working. I want to call function Logovani pass to that function var window and then recieved weburl and actwindow


Solution

  • so finally i fixed it like this

     member x.Logovani(window : string) : string ref =
                let weburl = ref ""   
                    browser.SwitchTo().Window(window) |> ignore
                    weburl := currentUrl()
                weburl
     end