如何在Browserstack中使用Canopy

3

我一直在使用F#测试库Canopy,它的表现非常出色。但是我无法弄清楚如何让它针对BrowserStack上的浏览器进行测试。我确实找到了这个,所以这是/曾经是可能的。

twitter.com/bryan_hunter/status/423352533877153792

1个回答

5
//Import the required libraries
open canopy
open runner
open System
open OpenQA.Selenium
open OpenQA.Selenium.Remote

//Set the BrowserStack specific capabilities 
let capability = new DesiredCapabilities()
capability.SetCapability("browserstack.user", "username")
capability.SetCapability("browserstack.key", "accesskey")
capability.SetCapability("os", "Windows")
capability.SetCapability("os_version", "7")
capability.SetCapability("browser", "Chrome")
capability.SetCapability("browser_version", "46.0")

//Setup Remote WebDriver to run on BrowserStack
let remote = Remote("http://hub.browserstack.com/wd/hub/", capability)

//Start the browser 
start remote

//Put your tests here

//Run all tests
run()

//close the driver
quit() 

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接