Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webview issues with calabash android - after having this keyboard_enter_text(text) steps are skipped #903

Open
prabhudorairaj85 opened this issue Nov 15, 2018 · 18 comments

Comments

@prabhudorairaj85
Copy link

I have a webview test which looks like this
steps def are looking like this
touch("webView css:'INPUT#username'")
keyboard_enter_text("username")
sleep 3
press_back_button
wait_for_element_exists("webView css:'INPUT#password'")
sleep 3
touch("webView css:'INPUT#password'")
keyboard_enter_text("password")
sleep 2
press_back_button
touch("webView css:'BUTTON'")
sleep 4
wait_for_element_exists("* marked:'subscription_chooser_item_name'")

when the test are made

after the execution , keyboard_enter_text("username"), the steps after that are skipped always.

can anyone help with this issue

@sherbhachu
Copy link

sherbhachu commented Nov 15, 2018 via email

@AndreyMitsyk
Copy link
Contributor

@prabhudorairaj85 Yes. Please make sure that your context is correct and please provide calabash-android version and where you trying to start tests (emalator/some device).

@prabhudorairaj85
Copy link
Author

prabhudorairaj85 commented Nov 15, 2018

thanks @AndreyMitsyk , i am using the lates calabash version 0.9.8 and trying to run on android devices.
just to be more clear: i have access the webview contents
i have webview page in my app, which requires username and password to be filled in to access the entire app.
so i have those above steps definitions,
but once the enter_keyboard _text("username") happens , all the steps below that are skipped

@AndreyMitsyk
Copy link
Contributor

@prabhudorairaj85 Could you please send adb logs from device?

# clean old logs
adb logcat -c
# receive new logs after keyboard_enter_text step
adb logcat -d

Which android device you are using and which Android version do you have on this device?

@prabhudorairaj85
Copy link
Author

prabhudorairaj85 commented Nov 15, 2018

@AndreyMitsyk android version is 6.0.1 and samsung s5

11-15 16:42:55.562 2413 2413 D PanelView: kidsfalse mQsExpansionEnabled:true
11-15 16:42:55.572 3262 3262 D SamsungIME: mIsEnableOCR = false
11-15 16:42:55.572 3262 3262 D SamsungIME: getValidMMCodes - failed to get the packageInfo of OCR or registered OCR Receiver
11-15 16:42:55.572 3262 3262 D SamsungIME: checking talkback status : false
11-15 16:42:55.572 3262 3262 D SamsungIME: mIsEnableOCR = false
11-15 16:42:55.572 3262 3262 D SamsungIME: getValidMMCodes - failed to get the packageInfo of OCR or registered OCR Receiver
11-15 16:42:55.582 3262 3262 D SamsungIME: checking talkback status : false
11-15 16:42:55.582 3262 3262 D SamsungIME: mIsEnableOCR = false
11-15 16:42:55.582 3262 3262 D SamsungIME: getValidMMCodes - failed to get the packageInfo of OCR or registered OCR Receiver
11-15 16:42:55.582 3262 3262 D SamsungIME: checking talkback status : false
11-15 16:42:55.612 1543 3016 V WindowStateAnimator: Finishing drawing window Window{468003d u0 d0 InputMethod}: mDrawState=DRAW_PENDING
11-15 16:42:55.612 31209 31209 D ViewRootImpl: MSG_RESIZED: ci=Rect(0, 72 - 0, 885) vi=Rect(0, 72 - 0, 885) or=1
11-15 16:42:55.622 412 412 D libEGL : eglInitialize EGLDisplay = 0xbeefb374
11-15 16:42:55.642 412 412 D libEGL : eglInitialize EGLDisplay = 0xbeefb374
11-15 16:42:55.642 3262 3262 D SamsungIME: SwiftkeyWrapper-checkCurrentSequence : use IC
11-15 16:42:55.652 3262 3262 D SamsungIME: Skip dismiss ExpandCandidate. it will be post-invalidated later
11-15 16:42:55.662 3262 3262 D SamsungIME: Skip dismiss ExpandCandidate. it will be post-invalidated later
11-15 16:42:55.682 3262 3262 D SamsungIME: Dump start
11-15 16:42:55.682 3262 3262 I SamsungIME: getDebugLevel : 0x4f4c
11-15 16:42:55.742 3262 3262 I System.out: Directory copied from /data/user/0/com.sec.android.inputmethod/app_KeyPressModelEx to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache
11-15 16:42:55.742 3262 3262 I System.out: File copied from /data/user/0/com.sec.android.inputmethod/app_KeyPressModelEx/model_0_-693868779.im to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/model_0_-693868779.im
11-15 16:42:55.742 3262 3262 I System.out: File copied from /data/user/0/com.sec.android.inputmethod/app_KeyPressModelEx/model_0_-2109163371.im to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/model_0_-2109163371.im
11-15 16:42:55.742 3262 3262 I System.out: File copied from /data/user/0/com.sec.android.inputmethod/app_KeyPressModelEx/model_1_-693868779.im to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/model_1_-693868779.im
11-15 16:42:55.742 3262 3262 I System.out: File copied from /data/user/0/com.sec.android.inputmethod/app_SwiftKey/languagePacks.json to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/languagePacks.json
11-15 16:42:55.742 3262 3262 I System.out: File copied from /data/user/0/com.sec.android.inputmethod/app_SwiftKey/settings.json to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/settings.json
11-15 16:42:55.742 3262 3262 I System.out: Directory copied from /data/user/0/com.sec.android.inputmethod/app_SwiftKey/user to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/user
11-15 16:42:55.742 3262 3262 I System.out: File copied from /data/user/0/com.sec.android.inputmethod/app_SwiftKey/user/learned.json to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/user/learned.json
11-15 16:42:55.742 3262 3262 I System.out: File copied from /data/user/0/com.sec.android.inputmethod/app_SwiftKey/user/.config to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/user/.config
11-15 16:42:55.742 3262 3262 I System.out: File copied from /data/user/0/com.sec.android.inputmethod/app_SwiftKey/user/dynamic.lm to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/user/dynamic.lm
11-15 16:42:55.742 3262 3262 I System.out: Directory copied from /data/user/0/com.sec.android.inputmethod/app_SwiftKey/tmp to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/tmp
11-15 16:42:55.752 3262 3262 I System.out: Directory copied from /data/user/0/com.sec.android.inputmethod/app_SwiftKey/en_GB to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/en_GB
11-15 16:42:55.812 3262 3262 I System.out: File copied from /data/user/0/com.sec.android.inputmethod/app_SwiftKey/en_GB/en_GB_fbg_c.lm3 to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/en_GB/en_GB_fbg_c.lm3
11-15 16:42:55.842 3262 3262 I System.out: File copied from /data/user/0/com.sec.android.inputmethod/app_SwiftKey/en_GB/en_GB_fbg_c.lm1 to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/en_GB/en_GB_fbg_c.lm1
11-15 16:42:55.932 3262 3262 I System.out: File copied from /data/user/0/com.sec.android.inputmethod/app_SwiftKey/en_GB/en_GB_fg_c.lm3 to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/en_GB/en_GB_fg_c.lm3
11-15 16:42:55.932 3262 3262 I System.out: File copied from /data/user/0/com.sec.android.inputmethod/app_SwiftKey/en_GB/.config to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/en_GB/.config
11-15 16:42:55.932 3262 3262 I System.out: File copied from /data/user/0/com.sec.android.inputmethod/app_SwiftKey/en_GB/charactermap.json to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/en_GB/charactermap.json
11-15 16:42:55.932 3262 3262 I System.out: File copied from /data/user/0/com.sec.android.inputmethod/app_SwiftKey/en_GB/punctuation.json to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/en_GB/punctuation.json
11-15 16:42:55.932 3262 3262 I System.out: File copied from /data/user/0/com.sec.android.inputmethod/app_SwiftKey/en_GB/punctuation-SDK1.2.json to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/en_GB/punctuation-SDK1.2.json
11-15 16:42:55.932 3262 3262 I System.out: File copied from /data/user/0/com.sec.android.inputmethod/app_SwiftKey/en_GB/ime.json to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/en_GB/ime.json
11-15 16:42:55.932 3262 3262 I System.out: Directory copied from /data/user/0/com.sec.android.inputmethod/app_SwiftKey/nb_NO to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/nb_NO
11-15 16:42:56.012 3262 3262 I System.out: File copied from /data/user/0/com.sec.android.inputmethod/app_SwiftKey/nb_NO/nb_NO_fbg_c.lm3 to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/nb_NO/nb_NO_fbg_c.lm3
11-15 16:42:56.042 3262 3262 I System.out: File copied from /data/user/0/com.sec.android.inputmethod/app_SwiftKey/nb_NO/nb_NO_fbg_c.lm1 to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/nb_NO/nb_NO_fbg_c.lm1

@prabhudorairaj85
Copy link
Author

@prabhudorairaj85 Yes. Please make sure that your context is correct and please provide calabash-android version and where you trying to start tests (emalator/some device).

@prabhudorairaj85
Copy link
Author

prabhudorairaj85 commented Nov 15, 2018

@sherbhachu just to your context, since i made a keyoard_enter_text, you say that i may be in hardware side, and do you know how to come back to the webview page

@prabhudorairaj85
Copy link
Author

@AndreyMitsyk may be this could help

11-15 16:51:57.652 3262 3262 I System.out: File copied from /data/user/0/com.sec.android.inputmethod/app_SwiftKey/en_GB-live/.config to /storage/emulated/0/Android/data/com.sec.android.inputmethod/cache/en_GB-live/.config
11-15 16:51:57.652 3262 3262 D SamsungIME: SwiftkeyWrapper-checkCurrentSequence : use IC
11-15 16:51:57.652 3262 3262 D SamsungIME: Skip dismiss ExpandCandidate. it will be post-invalidated later
11-15 16:51:57.652 3262 3262 D SamsungIME: Skip dismiss ExpandCandidate. it will be post-invalidated later
11-15 16:51:57.652 3262 3262 I Choreographer: Skipped 62 frames! The application may be doing too much work on its main thread.
11-15 16:51:57.662 31209 32724 I System.out: URI: //
11-15 16:51:57.662 31209 32724 I System.out: params: {json={"command":"keyboard_enter_text","arguments":["[email protected]"]}
11-15 16:51:57.662 31209 32724 I System.out: }
11-15 16:51:57.662 31209 32724 I System.out: header: {date=Thu, 15 Nov 2018 15:51:57 GMT, accept=/, content-length=61, host=127.0.0.1:34778, user-agent=HTTPClient/1.0 (2.8.3, ruby 2.3.7 (2018-03-28)), content-type=application/json;charset=utf-8}
11-15 16:51:57.662 31209 32724 I System.out: params: {json={"command":"keyboard_enter_text","arguments":["[email protected]"]}
11-15 16:51:57.662 31209 32724 I System.out: }
11-15 16:51:57.662 31209 32724 I System.out: ProP json = {"command":"keyboard_enter_text","arguments":["[email protected]"]}
11-15 16:51:57.662 31209 32724 I System.out: files: {}
11-15 16:51:57.662 31209 32724 I System.out: command: {"command":"keyboard_enter_text","arguments":["[email protected]"]}
11-15 16:51:57.662 31209 32724 I InstrumentationBackend: Got command:'Command:'Line:null,keyboard_enter_text', arguments:'[[email protected]]'
11-15 16:51:57.662 1543 3016 D CustomFrequencyManagerService: releaseDVFSLockLocked : Getting Lock type frm List : DVFS_MIN_LIMIT frequency : 1958400 uid : 1000 pid : 1543 tag : com.sec.android.inputmethod@65
11-15 16:51:57.682 412 412 D libEGL : eglInitialize EGLDisplay = 0xbeefb374
11-15 16:51:57.712 31209 32724 I System.out: result:{"bonusInformation":[],"message":"","success":true}
11-15 16:51:57.782 3262 3262 I SamsungIME: getNextShiftState() cursorCapsMode : 0
11-15 16:51:57.792 3262 3262 I SamsungIME: getNextShiftState() cursorCapsMode : 0
11-15 16:51:57.792 3262 3262 I SamsungIME: getNextShiftState() cursorCapsMode : 0
11-15 16:51:57.802 3262 3262 D SamsungIME: SwiftkeyWrapper-checkCurrentSequence : use IC
11-15 16:51:57.812 3262 3262 D SamsungIME: Skip dismiss ExpandCandidate. it will be post-invalidated later
11-15 16:51:59.992 1543 2290 V AlarmManager: Expired Alarm result :8
11-15 16:52:00.002 2413 2413 D KeyguardUpdateMonitor: received broadcast android.intent.action.TIME_TICK
11-15 16:52:00.002 2413 2413 I PERF : received broadcast android.intent.action.TIME_TICK
11-15 16:52:00.002 2413 2413 D KeyguardUpdateMonitor: handleTimeUpdate
11-15 16:52:00.012 2413 2413 D SecKeyguardClockView: onTimeChanged() : mShouldShowDualClock - false, isDualClockSet() -false
11-15 16:52:00.022 2413 2413 D DateView: regionalDateFormat = HH:mm isRTLlanguage = false returnDateFormat = E, d MMMM
11-15 16:52:00.022 2413 2413 D DateView: regionalDateFormat = HH:mm isRTLlanguage = false returnDateFormat = E, d MMMM
11-15 16:52:00.022 2413 2413 D DateView: regionalDateFormat = HH:mm isRTLlanguage = false returnDateFormat = E, d MMMM
11-15 16:52:00.022 2413 2413 D DateView: regionalDateFormat = HH:mm isRTLlanguage = false returnDateFormat = E, d MMMM
11-15 16:52:00.022 2413 2413 D DateView: regionalDateFormat = HH:mm isRTLlanguage = false returnDateFormat = E, d MMMM
11-15 16:52:00.022 2413 2413 D DateView: regionalDateFormat = HH:mm isRTLlanguage = false returnDateFormat = E, d MMMM
11-15 16:52:00.022 2413 2413 D SecKeyguardStatusUtils: regionalDateFormat = HH:mm isRTLlanguage = false returnDateFormat = E, d MMMM
11-15 16:52:00.102 2413 2413 D SecKeyguardStatusUtils: regionalDateFormat = HH:mm isRTLlanguage = false returnDateFormat = E, d MMMM
11-15 16:52:00.132 27350 27350 D daemonapp: [MSC_Daemon]>>> WU:1294 [0:0] SS h:21, m:0
11-15 16:52:00.452 2413 2413 D KeyguardUpdateMonitor: received broadcast android.intent.action.BATTERY_CHANGED
11-15 16:52:00.452 2413 2413 I PERF : received broadcast android.intent.action.BATTERY_CHANGED
11-15 16:52:00.452 2413 2413 D KeyguardUpdateMonitor: handleBatteryUpdate
11-15 16:52:00.452 1543 5864 D BatteryService: !@BatteryListener : batteryPropertiesChanged!
11-15 16:52:00.452 1543 5864 D BatteryService: level:57, scale:100, status:2, health:2, present:true, voltage: 3943, temperature: 294, technology: Li-ion, AC powered:false, USB powered:true, POGO powered:false, Wireless powered:false, icon:17303590, invalid charger:0, maxChargingCurrent:0
11-15 16:52:00.452 1543 5864 D BatteryService: online:4, current avg:450, charge type:1, power sharing:false, high voltage charger:false, capacity:280000, batterySWSelfDischarging:false, current_now:450
11-15 16:52:00.452 1543 1543 D BatteryService: Sending ACTION_BATTERY_CHANGED.
11-15 16:52:00.452 1543 1543 I MotionRecognitionService: Plugged

@AndreyMitsyk
Copy link
Contributor

@prabhudorairaj85 Could you please try to find some errors with "calaba" prefix in adb logs?
If it possible, try to test your app on device with android 9 or on simulator with android 9 (api28).
Right now calabash-android-server have 2 ways how to enter text in webview. New method is a bit experimental, so it was enabled only for api > 27.

@prabhudorairaj85
Copy link
Author

@AndreyMitsyk : i tried with android version 8. the test seems to going through when executed via
calabash-android run test.apk
but while running through calabash-android console test.apk
the it breaks after enter_keyboard_text.

can you help to fix this
wait_for_element_exists("* marked:'Logga in'")
touch("* marked:'Logga in'")
wait_for_element_exists("webView css:'span' {textContent CONTAINS 'Användarnamn'}")
sleep 3
touch("webView css:'span' {textContent CONTAINS 'Användarnamn'}")
sleep 2
touch("webView css:'INPUT#username'")
system("adb logcat -c")
system("adb logcat -d")
keyboard_enter_text(username)
sleep 3
press_back_button
wait_for_element_exists("webView css:'INPUT#password'")
sleep 3
touch("webView css:'INPUT#password'")
keyboard_enter_text(password)
sleep 2
press_back_button

@prabhudorairaj85
Copy link
Author

@AndreyMitsyk i also tried in motoG5, with android v8.1.0. i face the same issue.can you help me solve this

@AndreyMitsyk
Copy link
Contributor

@prabhudorairaj85 Sorry for delay. I can't investigate issue on my local machine right now. Hopefully I will do this by the end of this week. Anyway I thinking about sleep: is it possible to remove it and see what happened? E.g.:

touch("webView css:'INPUT#username'")
system("adb logcat -c")
keyboard_enter_text(username)
press_back_button
wait_for_element_exists("webView css:'INPUT#password'")
touch("webView css:'INPUT#password'")
system("adb logcat -d")

@prabhudorairaj85
Copy link
Author

@AndreyMitsyk : yes its still a issue , even though i removed the sleep .

@AndreyMitsyk
Copy link
Contributor

@prabhudorairaj85 I can't repro this with Android 9 device and sample app with webview.
Just to confirm my idea, could you please try to use Android 9 simulator?

@prabhudorairaj85
Copy link
Author

@AndreyMitsyk as i said earlier , from android 8 and above , it works better but version lesser than that or not working .

@AndreyMitsyk
Copy link
Contributor

@prabhudorairaj85 in this case new webview input logic can fix issue at least for android 6+ devices. Right now it's active only for latest versions:
https://github.com/calabash/calabash-android-server/blob/develop/server/app/src/androidTest/java/sh/calaba/instrumentationbackend/actions/text/TextAction.java#L73
@jmoody @john7doe is it ok for you to use new webview input logic for these versions (android 6+)?
I don't remember any issues with this code on latest devices, so we can try to enable it for other devices too.

@prabhudorairaj85
Copy link
Author

@AndreyMitsyk : thank you. just let me know when you release a fix for this new webview input logic.
and also let me know how it can be used

@jmoody
Copy link
Contributor

jmoody commented Dec 7, 2018

I am afraid, I don't have an opinion.

Make a pull request on the server to change the version and we will see if it gets picked up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants