脚本在Browserstack上间歇性失败。
使用serenity-bdd,并在浏览器堆栈上执行。...
DesiredCapabilities capabilities = new DesiredCapabilities();
if (MyDriverClass.deviceType.equalsIgnoreCase("Tablet")) {
capabilities.setCapability("os_version", "8.0");
capabilities.setCapability("device", "Samsung Galaxy Tab S3");
capabilities.setCapability("real_mobile", "true");
capabilities.setCapability("browserstack.platform",
"ANDROID");
capabilities.setCapability("project", "Tablet_PROJECT");
capabilities.setCapability("browserstack.browser", "chrome");
capabilities.setCapability("browserstack.browser_version", "76.0");
//also used appium version 1.6.5
capabilities.setCapability("browserstack.appium_version", "1.7.1");
capabilities.setCapability("deviceOrientation", orientation);
capabilities.setCapability("browserstack.local", browserstackLocal);
capabilities.setCapability("browserstack.localIdentifier",
browserstackLocalIdentifier);
capabilities.setCapability("browserstack.debug", true);
capabilities.setCapability("browserstack.video", true);
capabilities.setCapability("build", browserStackTCBuild);
return new RemoteWebDriver(
new URL("https://" + username + ":" + accessKey + "@hub-
cloud.browserstack.com/wd/hub"),`enter code here`
capabilities);
我不确定为什么会出现服务器端错误。甚至所有脚本都与元素相关,并且定位器位于页面和视图中。
答案 0 :(得分:0)
当您要查找的元素被隐藏/不可见时,通常会遇到未知服务器端错误。
您将需要确保要定位的元素在视口中,并且没有任何东西覆盖它。您可以详细了解上述错误here的确切原因。