【问题标题】:To click on all check box and match [Ruby Selenium-webdriver]单击所有复选框并匹配 [Ruby Selenium-webdriver]
【发布时间】:2016-07-28 12:24:10
【问题描述】:

当我点击全选复选框时,右上角的值显示您“选择了 4”,我需要编写大小写以匹配选定的 4

我该怎么做?我正在使用红宝石硒

driver.find_element(:name, "xbox").click 
element :selectedcount, :css, 'span[id=systems_removal_count]'

【问题讨论】:

    标签: selenium-webdriver rspec capybara


    【解决方案1】:

    您的问题不是很清楚,但看起来您正在使用 site_prism,所以我假设您有某种页面对象,我将其命名为 @home,在其上定义了 selectedCount 元素。 Mathew 来检查您可以执行类似操作的文本

    expect(@home.selectedCount).to have_text('selected 4')
    

    或者

    expect(@home.selectedCount).to have_text('4')
    

    具体取决于您对该元素的期望

    【讨论】:

      猜你喜欢
      • 2015-12-03
      • 2018-04-24
      • 2015-12-07
      • 1970-01-01
      • 1970-01-01
      • 2018-11-14
      • 2020-04-25
      • 2019-05-18
      相关资源
      最近更新 更多