我一直是 f# 测试库 Canopy 的用户,它运行良好。但我不知道如何让它针对浏览器堆栈上的浏览器。我确实找到了这个,但这是/可能的。
问问题
313 次
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()
于 2016-01-18T16:57:45.773 回答