Search code examples
androidcucumbercalabashcalabash-android

Running calabash test cases on Android simulator


I am running calabash test cases on Android simulator. My test cases work fine on device, But on simulator, when I execute a touch button action. It does not auto scroll downwards, to find the text. It simply checks on the visible screen area, and does not execute. Whereas on device it auto scrolls. I am using a 2.3.3 simulator.

Please help!!


Solution

  • The issue was that I was running the test cases on a remote virtual machine, which supposedly has issues with UI rendering. I solved it by modifying the calabash touch method as follows :

    def touch_event(text)
            q = query("* text:'#{text}'")
    
            while q.empty?
                scroll('down')
                q = query("* text:'#{text}'")
            end 
    
            touch("* text:'#{text}'")
    end