且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

蠡机器人,只要点击一个ListView?

更新时间:2023-11-19 08:26:52

尝试了这一点。

添加一个定义红宝石步文件。

Add a definition to ruby step file.

Then /^I scroll to cell with "([^\"]*)" label and touch it$/ do |name|
    element="TextView text:'#{name}'"      
    if !element_exists(element)
        wait_poll(:until_exists => "TextView text:'#{name}'", :timeout => WAIT_TIMEOUT) do
            performAction('scroll_down')
        end
        if element_exists(element)
            touch(element)
            sleep(STEP_PAUSE)
        else
            screenshot_and_raise "could not find the cell"
        end
        else
            touch(element)
            sleep(STEP_PAUSE)
        end
end

和来自特征文件称之为然后我滚动到细胞与cellMainLabel的标签并触摸

and call it from feature file Then I scroll to cell with "cellMainLabel" label and touch it