hello,
My test script runs fine throws no error and appium also dont show any error,but the main objective for which i wrote the script is not making appium click on the ‘Log In’ button of book my show app on emulator.
Here is my test script on eclipse :
import static org.junit.Assert.*;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.MobileCapabilityType;
import io.appium.java_client.remote.MobilePlatform;
public class desiredcapab {
@Test
public void test() throws MalformedURLException {
File appDir = new File("src");
File app = new File(appDir, "bookMyShow-ucb.apk");
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(MobileCapabilityType.PLATFORM_NAME , MobilePlatform.ANDROID);
cap.setCapability(MobileCapabilityType.DEVICE_NAME ,"Android Emulator");
cap.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, "100");
cap.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
AndroidDriver driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), cap) ;
//driver.manage().timeouts().implicitlyWait(300,TimeUnit.SECONDS);
driver.findElementById("com.bt.bms:id/rlyIntroButtons").click();
}
}
Here is my appium log:
Killed Node Server.
Node Server Process Ended
Starting Node Server
warn: Appium support for versions of node < 0.12 has been deprecated and will be removed in a future version. Please upgrade!
info: Welcome to Appium v1.4.0 (REV 8f63e2f91ef7907aed8bda763f4e5ca08e86970a)
info: Appium REST http interface listener started on 127.0.0.1:4723
info: [debug] Non-default server args: {“address”:“127.0.0.1”,“logNoColors”:true,“platformName”:“Android”,“platformVersion”:“18”,“automationName”:“Appium”}
info: Console LogLevel: debug
info: → POST /wd/hub/session {“desiredCapabilities”:{“app”:“C:\Users\jenny howard\workspace\Introduction\src\bookMyShow-ucb.apk”,“platformName”:“Android”,“deviceName”:“Android Emulator”,“newCommandTimeout”:“100”}}
info: Client User-Agent string: Apache-HttpClient/4.4.1 (Java/1.8.0_60)
info: [debug] No appActivity desired capability or server param. Parsing from apk.
info: [debug] No appPackage desired capability or server param. Parsing from apk.
info: [debug] Using local app from desired caps: C:\Users\jenny howard\workspace\Introduction\src\bookMyShow-ucb.apk
info: [debug] Creating new appium session 8f6e6591-08a9-4ae6-a78d-97012aecc9b3
info: Starting android appium
info: [debug] Getting Java version
info: Java version is: 1.8.0_60
info: [debug] Checking whether adb is present
info: [debug] Using adb from C:\Android\sdk\platform-tools\adb.exe
info: [debug] Parsing package and activity from app manifest
info: [debug] Checking whether aapt is present
info: [debug] Using aapt from C:\Android\sdk\build-tools\23.0.1\aapt.exe
info: [debug] Extracting package and launch activity from manifest.
info: [debug] executing cmd: C:\Android\sdk\build-tools\23.0.1\aapt.exe dump badging “C:\Users\jenny howard\workspace\Introduction\src\bookMyShow-ucb.apk”
info: [debug] badging package: com.bt.bms
info: [debug] badging act: com.bt.bms.activities.SplashActivity
info: [debug] Parsed package and activity are: com.bt.bms/com.bt.bms.activities.SplashActivity
info: [debug] Set chromedriver binary as: C:\Program Files (x86)\Appium\node_modules\appium\build\chromedriver\windows\chromedriver.exe
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Checking whether app is actually present
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices…
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe devices
info: [debug] 1 device(s) connected
info: Found device emulator-5554
info: [debug] Setting device id to emulator-5554
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 wait-for-device
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell “echo ‘ready’”
info: [debug] Starting logcat capture
info: [debug] Getting device API level
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 18
info: Device API level is: 18
info: [debug] Extracting strings for language: default
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell “getprop persist.sys.language”
info: [debug] Current device persist.sys.language: en
info: [debug] java -jar “C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar” “stringsFromApk” “C:\Users\jenny howard\workspace\Introduction\src\bookMyShow-ucb.apk” “C:\Users\JENNYH~1\AppData\Local\Temp\com.bt.bms” en
info: [debug] No strings.xml for language ‘en’, getting default strings.xml
info: [debug] java -jar “C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar” “stringsFromApk” “C:\Users\jenny howard\workspace\Introduction\src\bookMyShow-ucb.apk” “C:\Users\JENNYH~1\AppData\Local\Temp\com.bt.bms”
info: [debug] Reading strings from converted strings.json
info: [debug] Setting language to default
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 push “C:\Users\JENNYH~1\AppData\Local\Temp\com.bt.bms\strings.json” /data/local/tmp
info: [debug] Checking whether aapt is present
info: [debug] Using aapt from C:\Android\sdk\build-tools\23.0.1\aapt.exe
info: [debug] Retrieving process from manifest.
info: [debug] executing cmd: C:\Android\sdk\build-tools\23.0.1\aapt.exe dump xmltree “C:\Users\jenny howard\workspace\Introduction\src\bookMyShow-ucb.apk” AndroidManifest.xml
info: [debug] Set app process to: com.bt.bms
info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Checking app cert for C:\Users\jenny howard\workspace\Introduction\src\bookMyShow-ucb.apk.
info: [debug] executing cmd: java -jar “C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\verify.jar” “C:\Users\jenny howard\workspace\Introduction\src\bookMyShow-ucb.apk”
info: [debug] App already signed.
info: [debug] Zip-aligning C:\Users\jenny howard\workspace\Introduction\src\bookMyShow-ucb.apk
info: [debug] Checking whether zipalign is present
info: [debug] Using zipalign from C:\Android\sdk\build-tools\23.0.1\zipalign.exe
info: [debug] Zip-aligning apk.
info: [debug] executing cmd: C:\Android\sdk\build-tools\23.0.1\zipalign.exe -f 4 “C:\Users\jenny howard\workspace\Introduction\src\bookMyShow-ucb.apk” C:\Users\JENNYH~1\AppData\Local\Temp\11598-3156-ji0je8\appium.tmp
info: [debug] MD5 for app is 8c3d1b1372441237108d673a6fe85c8f
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell “ls /data/local/tmp/8c3d1b1372441237108d673a6fe85c8f.apk”
info: [debug] Getting install status for com.bt.bms
info: [debug] Getting device API level
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 18
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell “pm list packages -3 com.bt.bms”
info: [debug] App is installed
info: App is already installed, resetting app
info: [debug] Running fast reset (stop and clear)
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell “am force-stop com.bt.bms”
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell “pm clear com.bt.bms”
info: [debug] Forwarding system:4724 to device:4724
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 forward tcp:4724 tcp:4724
info: [debug] Pushing appium bootstrap to device…
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 push “C:\Program Files (x86)\Appium\node_modules\appium\build\android_bootstrap\AppiumBootstrap.jar” /data/local/tmp/
info: [debug] Pushing settings apk to device…
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 install “C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk”
info: [debug] Pushing unlock helper app to device…
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 install “C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk”
info: Starting App
info: [debug] Attempting to kill all ‘uiautomator’ processes
info: [debug] Getting all processes with ‘uiautomator’
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell “ps ‘uiautomator’”
info: [debug] No matching processes found
info: [debug] Running bootstrap
info: [debug] spawning: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.bt.bms -e disableAndroidWatchers false
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
info: [debug] Waking up device if it’s not alive
info: [debug] Pushing command to appium work queue: [“wake”,{}]
info: [debug] [BOOTSTRAP] [debug] Loading json…
info: [debug] [BOOTSTRAP] [debug] json loading complete.
info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
info: [debug] [BOOTSTRAP] [debug] Client connected
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“wake”,“params”:{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: wake
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:true,“status”:0}
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell “dumpsys window”
info: [debug] Screen already unlocked, continuing.
info: [debug] Pushing command to appium work queue: [“getDataDir”,{}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“getDataDir”,“params”:{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:“/data”,“status”:0}
info: [debug] dataDir set to: /data
info: [debug] Pushing command to appium work queue: [“compressedLayoutHierarchy”,{“compressLayout”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“compressedLayoutHierarchy”,“params”:{“compressLayout”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:false,“status”:0}
info: [debug] Getting device API level
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 18
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell “am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.bt.bms/com.bt.bms.activities.SplashActivity”
info: [debug] Waiting for pkg “com.bt.bms” and activity “com.bt.bms.activities.SplashActivity” to be focused
info: [debug] Getting focused package and activity
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell “dumpsys window windows”
info: [debug] Getting focused package and activity
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell “dumpsys window windows”
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell “getprop ro.build.version.release”
info: [debug] Device is at release version 4.3.1
info: [debug] Device launched! Ready for commands
info: [debug] Setting command timeout to 100 secs
info: [debug] Appium session started with sessionId 8f6e6591-08a9-4ae6-a78d-97012aecc9b3
info: ← POST /wd/hub/session 303 74797.156 ms - 74
info: → GET /wd/hub/session/8f6e6591-08a9-4ae6-a78d-97012aecc9b3 {}
info: [debug] Responding to client with success: {“status”:0,“value”:{“platform”:“LINUX”,“browserName”:“Android”,“platformVersion”:“4.3.1”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“app”:“C:\Users\jenny howard\workspace\Introduction\src\bookMyShow-ucb.apk”,“platformName”:“Android”,“deviceName”:“Android Emulator”,“newCommandTimeout”:“100”},“app”:“C:\Users\jenny howard\workspace\Introduction\src\bookMyShow-ucb.apk”,“platformName”:“Android”,“deviceName”:“emulator-5554”,“newCommandTimeout”:“100”},“sessionId”:“8f6e6591-08a9-4ae6-a78d-97012aecc9b3”}
info: ← GET /wd/hub/session/8f6e6591-08a9-4ae6-a78d-97012aecc9b3 200 9.708 ms - 656 {“status”:0,“value”:{“platform”:“LINUX”,“browserName”:“Android”,“platformVersion”:“4.3.1”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“app”:“C:\Users\jenny howard\workspace\Introduction\src\bookMyShow-ucb.apk”,“platformName”:“Android”,“deviceName”:“Android Emulator”,“newCommandTimeout”:“100”},“app”:“C:\Users\jenny howard\workspace\Introduction\src\bookMyShow-ucb.apk”,“platformName”:“Android”,“deviceName”:“emulator-5554”,“newCommandTimeout”:“100”},“sessionId”:“8f6e6591-08a9-4ae6-a78d-97012aecc9b3”}
info: → POST /wd/hub/session/8f6e6591-08a9-4ae6-a78d-97012aecc9b3/element {“using”:“id”,“value”:“com.bt.bms:id/rlyIntroButtons”}
info: [debug] Waiting up to 0ms for condition
info: [debug] Pushing command to appium work queue: [“find”,{“strategy”:“id”,“selector”:“com.bt.bms:id/rlyIntroButtons”,“context”:“”,“multiple”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“id”,“selector”:“com.bt.bms:id/rlyIntroButtons”,“context”:“”,“multiple”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding com.bt.bms:id/rlyIntroButtons using ID with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.bt.bms:id/rlyIntroButtons]
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:{“ELEMENT”:“1”},“status”:0}
info: [debug] Responding to client with success: {“status”:0,“value”:{“ELEMENT”:“1”},“sessionId”:“8f6e6591-08a9-4ae6-a78d-97012aecc9b3”}
info: ← POST /wd/hub/session/8f6e6591-08a9-4ae6-a78d-97012aecc9b3/element 200 23023.408 ms - 87 {“status”:0,“value”:{“ELEMENT”:“1”},“sessionId”:“8f6e6591-08a9-4ae6-a78d-97012aecc9b3”}
info: → POST /wd/hub/session/8f6e6591-08a9-4ae6-a78d-97012aecc9b3/element/1/click {“id”:“1”}
info: [debug] Pushing command to appium work queue: [“element:click”,{“elementId”:“1”}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“1”}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: click
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:true,“status”:0}
info: [debug] Responding to client with success: {“status”:0,“value”:true,“sessionId”:“8f6e6591-08a9-4ae6-a78d-97012aecc9b3”}
info: ← POST /wd/hub/session/8f6e6591-08a9-4ae6-a78d-97012aecc9b3/element/1/click 200 4283.781 ms - 76 {“status”:0,“value”:true,“sessionId”:“8f6e6591-08a9-4ae6-a78d-97012aecc9b3”}
info: [debug] Didn’t get a new command in 100 secs, shutting down…
info: Shutting down appium session
info: [debug] Pressing the HOME button
info: [debug] executing cmd: C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell “input keyevent 3”
info: [debug] Stopping logcat capture
info: [debug] Logcat terminated with code null, signal SIGTERM
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“shutdown”}
info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:“OK, shutting down”,“status”:0}
info: [debug] Sent shutdown command, waiting for UiAutomator to stop…
info: [debug] [BOOTSTRAP] [debug] Closed client connection
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.
info: [debug] [UIAUTOMATOR STDOUT] Time: 159.595
info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
info: [debug] UiAutomator shut down normally
info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
info: [debug] We shut down because no new commands came in
The above script doesnt click on ‘Log In’ button also it doesnt throw any error,
i dont know what is missing,please guide
Thanks,
Jenny