在我的应用程序中,我检查了任何一个复选框,然后单击“保存”按钮。我使用table如下选择选项,但它不起作用:
var converter = new BrushConverter();
BorderBrush = converter.ConvertFromString("Red") as SolidColorBrush
但它不起作用.....
为此所有者选择国家/地区
# with in table, set
within_table('countryTable') do
find(:xpath, "//tbody/tr/td[1]/checkbox").set(true)
end
click_button('Save')
答案 0 :(得分:2)
您可以通过id,css或xpath访问该复选框。
# to check the FR with xpath
find(:xpath, "//input[@name='FR']").click()
# to check the FR with id
find(:id, "CheckboxFR").click()
# to check the FR with css
find(:css, "#CheckboxFR").click()
如果你想使用范围缩小的within_table:
within_table(find(:id, "table_id")) do
find(:id, "id_of_option").click()
end