1.我有一个小 cucumber 步骤And I switch to "About" tab
1.步骤已创建
And (/^I switch to "([^"]*)" tab$/) do |tabName|
@screens.main.switch_to_tab(tabName)
end
字符串
1.方法来单击该选择器
class Main
def tab_button
@tab_button = Elements.new(:uiautomator,`new UiSelector().resourceId(tab-button-#{@tab})`)
end
def switch_to_tab(tabName)
@tab = tabName.downcase
tab_button
@tab_button.click
end
end
And console throws error
Could not parse selector expression `new UiSelector().resourceId(tab-button-about)`: `UiSelector` doesn't have suitable method `resourceId` with arguments ¡tab-button-about¿: Could not parse selector expression `new UiSelector().resourceId(tab-button-about)`: tab-button-about is not a string; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors£invalid-selector-exception (Selenium::WebDriver::Error::InvalidSelectorError)
的数据
怎么解决?
1条答案
按热度按时间ifsvaxew1#
已解决使用双引号
字符串