We are going to add some steps to this script - add a MMS first, then discard it.
So we need to find the adding message icon and click it. We can use uiautomatorviewer
to get it.
We can get the "resource-id" of the icon, and use it to locate it, then click it.
In the script, we can write following to achieve the goal:
mms = find_element id: 'com.android.mms:id/action_compose_new'
mms.click
And we can get this screen in app:
Now the script should look like:
require 'rubygems'
require 'appium_lib'
caps = { caps: { platformName: 'Android', appActivity: 'ui.ConversationList', appPackage: 'com.android.mms' }, appium_lib: { sauce_username: nil, sauce_access_key: nil } }
driver = Appium::Driver.new(caps)
Appium.promote_appium_methods self.class
driver.start_driver.manage.timeouts.implicit_wait = 20 # seconds
mms = find_element id: 'com.android.mms:id/action_compose_new'
mms.click