【发布时间】:2020-01-01 21:34:37
【问题描述】:
我为 Android TV 流媒体应用编写自动化程序,运行测试时遇到问题。当我尝试运行 test 时,出现错误:
org.openqa.selenium.WebDriverException:处理命令时发生未知的服务器端错误。原始错误:io.appium.uiautomator2.common.exceptions.UiAutomator2Exception: java.lang.IllegalArgumentException: Namespace with prefix 'com.onoapps.some.dev' has not been declared。
谁知道问题出在哪里?
我正在使用:
- 小米盒子。
- Java
- Appium
- JUnit
这就是我想要做的。
public class RemoteControl extends AppiumBaseClass {
public RemoteControl(AppiumDriver driver) {
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
}
@AndroidFindBy(xpath = "//com.onoapps.some.dev:id/topRootId[@focusable='true']")
private MobileElement currentTab;
public String getCurrentTabName() {
MobileElement tabText = currentTab.findElement(By.id("com.onoapps.some.dev:id/topBarItemTextViewId"));
return tabText.getText();
}
}
public class SeriesScreenFlows extends BaseTestClass {
public void getSeriesTab(){
getCurrentTabName();
}
}
public class BaseTestClass extends AppiumBaseClass {
public WebDriverWait wait;
public Series_screen series_screen;
public RemoteControl remoteControl;
@Before
public void setUp() throws MalformedURLException {
AppiumController.instance.start();
series_screen = new Series_screen(driver());
remoteControl = new RemoteControl(driver());
}
}
【问题讨论】:
标签: java android junit automation appium