Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Robotium 进行 android UI 自动化。我被困在我试图点击应用程序中最初禁用的按钮的地方。Robotium 找不到文本或按钮。我正在尝试以下代码。
if (solo.searchText(".*android.*")) { solo.clickOnText(".*android.*"); } else solo.goBack();
单击该按钮将启用它。提前致谢。
试试这个 :
for(View v: solo.getViews()) { if(v instanceof Button) { if( ((Button)v).getText().toString().equalsIgnoreCase("some text") ) { solo.clickOnView(v); solo.sleep(3000); break; } } }