Thursday 11 April 2013

Adb command sequence to take picture and save it

there are list of ruby commands that can be used in calabash-android to get pciture from camera and save it

I had this problem running commands from calabash to take pciture, I was able to get past it using these 2 functions


def takePicFromCamera
   system('adb shell input keyevent 27') # click take picture button
end

  # save picture by clicking on save
  def savePicture
    system('adb shell input keyevent 21')
    Page.new.waitFor(2) # waitfor 2 second
    system('adb shell input keyevent 22') # select save
    Page.new.waitFor(2) # waitfor 2 second
    system('adb shell input keyevent 23') # Click save
    Page.new.waitFor(5) # waitfor 5 second
end

No comments:

Post a Comment