我一直在尝试将文件上传到BrowserStack提供的移动模拟器。但是,我知道任何时候出现错误,平台都设置为Mac OSX,而不是Windows(我上传文件)。如何更改驱动程序信息指定的平台?
注意:我正在使用Selenium
在Python中编写测试这是错误的样子:
未知错误:点(108,458)无法点击元素(会话信息:webview = 37.0.0.0)(驱动程序信息:chromedriver = 2.18.343837(sessionidhere),平台= Mac OS X 10.10.5 x86_64)
注意:sessionidhere不是字面意思
答案 0 :(得分:0)
import selenium.webdriver as webdriver
desired_cap = {'os': 'Windows', 'os_version': 'xp', 'browser': 'IE', 'browser_version': '7.0'}
driver = webdriver.Remote(
command_executor='http://logindetailshere@hub.browserstack.com:80/wd/hub',
desired_capabilities=desired_cap)
出错时,在这种情况下单击一个不存在的元素,会显示以下详细信息:
Capabilities [{browserAttachTimeout = 0,enablePersistentHover = false, ie.forceCreateProcessApi = false,pageLoadStrategy = normal, ie.usePerProcessProxy = false,ignoreZoomSetting = false, handlesAlerts = true,version = 7,platform = WINDOWS,nativeEvents = false, ie.ensureCleanSession = true,elementScrollBehavior = 0, ie.browserCommandLineSwitches =,requireWindowFocus = false, browserName = internet explorer,initialBrowserUrl = about:blank, takesScreenshot = true,javascriptEnabled = true, ignoreProtectedModeSettings = false,enableElementCacheCleanup = true, cssSelectorsEnabled = true,unexpectedAlertBehaviour = dismiss}]