Coder Social home page Coder Social logo

Comments (11)

jonasmaturana avatar jonasmaturana commented on August 17, 2024

We use the short names for ids. In your case that would be "home_label".
I will update the documentation with a note about this.

from calabash-android.

atcrao avatar atcrao commented on August 17, 2024

Even with short id's I noticed the same issue.

getViewById: Looking for view home_label which does not have an id (RuntimeError)
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/timeout.rb:62:in timeout' features/my_first.feature:15:inThen I press view with id "home_label"'

from calabash-android.

atcrao avatar atcrao commented on August 17, 2024

HI,

I just replied to the closed issue in the forum. I noticed the same
problem or error even when I provided short id's.

Thanks
Surya

On Mon, Jun 11, 2012 at 8:11 AM, Jonas Maturana Larsen <
[email protected]

wrote:

We use the short names for ids. In your case that would be "home_label".
I will update the documentation with a note about this.


Reply to this email directly or view it on GitHub:
#51 (comment)

from calabash-android.

jonasmaturana avatar jonasmaturana commented on August 17, 2024

Try to install your app on the emulator and use the hierarchyviewer to inspect the view hierarchy. It the name there?

Can you share the logcat output you get from running the test?

I reopened the issue

from calabash-android.

atcrao avatar atcrao commented on August 17, 2024

HI Jonas,

Thanks for reopening this issue.

I am able to reproduce this consistently.

I do see the id in hierarchy viewer on eBay activity and also if I run plain vanilla robotium test case it works fine.
For example:-
solo.clickOnView(solo.getCurrentActivity().findViewById(
com.ebay.mobile.R.id.home_messages_label));

logcat details:-

I/appLifecycle( 459): com.ebay.mobile.activities.eBay.onPostResume() - com.ebay.fw.app.BaseActivity
V/eBay ( 459): Deals US: deal support
I/ActivityManager( 73): Displayed activity com.ebay.mobile/.activities.eBay: 5450 ms (total 5450 ms)
I/IntrumentationBackend( 459): Added:'NullAction', with key:'nullAction'
I/IntrumentationBackend( 459): Added:'PressButtonNumber', with key:'press_button_number'
I/IntrumentationBackend( 459): Added:'PressButtonText', with key:'press_button_with_text'
I/IntrumentationBackend( 459): Added:'PressImageButtonNumber', with key:'press_image_button_number'
I/IntrumentationBackend( 459): Added:'WaitForButton', with key:'wait_for_button'
I/IntrumentationBackend( 459): Added:'ToggleCheckboxNumber', with key:'toggle_numbered_checkbox'
I/IntrumentationBackend( 459): Added:'LongPressText', with key:'press_long_on_text'
I/IntrumentationBackend( 459): Added:'LongPressTextAndSelectFromMenuById', with key:'press_long_on_text_and_select_with_id'
I/IntrumentationBackend( 459): Added:'LongPressTextAndSelectFromMenuByIndex', with key:'press_long_on_text_and_select_with_index'
I/IntrumentationBackend( 459): Added:'LongPressTextAndSelectFromMenuByText', with key:'press_long_on_text_and_select_with_text'
I/IntrumentationBackend( 459): Added:'ClickOnScreen', with key:'click_on_screen'
I/IntrumentationBackend( 459): Added:'Swipe', with key:'swipe'
I/IntrumentationBackend( 459): Added:'ListActions', with key:'list_actions'
I/IntrumentationBackend( 459): Added:'LongPressListItems', with key:'long_press_list_item'
I/IntrumentationBackend( 459): Added:'PressListItems', with key:'press_list_item'
I/IntrumentationBackend( 459): Added:'FakeGPSLocation', with key:'set_gps_coordinates'
I/IntrumentationBackend( 459): Added:'ScrollDown', with key:'scroll_down'
I/IntrumentationBackend( 459): Added:'ScrollUp', with key:'scroll_up'
I/IntrumentationBackend( 459): Added:'DownKey', with key:'send_key_down'
I/IntrumentationBackend( 459): Added:'EnterKey', with key:'send_key_enter'
I/IntrumentationBackend( 459): Added:'GoBack', with key:'go_back'
I/IntrumentationBackend( 459): Added:'PressMenu', with key:'press_menu'
I/IntrumentationBackend( 459): Added:'SelectFromMenuByText', with key:'select_from_menu'
I/IntrumentationBackend( 459): Added:'SelectSpinnerItemByContentDescription', with key:'select_item_from_named_spinner'
I/IntrumentationBackend( 459): Added:'AssertText', with key:'assert_text'
I/IntrumentationBackend( 459): Added:'AssertTextOfSpecificTextViewByContentDescription', with key:'assert_text_in_textview'
I/IntrumentationBackend( 459): Added:'ClearTextByIndex', with key:'clear_numbered_field'
I/IntrumentationBackend( 459): Added:'ClearTextFieldByContentDescription', with key:'clear_named_field'
I/IntrumentationBackend( 459): Added:'ClickOnText', with key:'click_on_text'
I/IntrumentationBackend( 459): Added:'EnterTextByContentDescription', with key:'enter_text_into_named_field'
I/IntrumentationBackend( 459): Added:'EnterTextByIndex', with key:'enter_text_into_numbered_field'
I/IntrumentationBackend( 459): Added:'SetDateByContentDescription', with key:'set_date_with_description'
I/IntrumentationBackend( 459): Added:'SetDateByIndex', with key:'set_date_with_index'
I/IntrumentationBackend( 459): Added:'SetTimeByContentDescription', with key:'set_time_with_description'
I/IntrumentationBackend( 459): Added:'SetTimeByIndex', with key:'set_time_with_index'
I/IntrumentationBackend( 459): Added:'ClickOnViewById', with key:'click_on_view_by_id'
I/IntrumentationBackend( 459): Added:'LongPressOnViewById', with key:'long_press_on_view_by_id'
I/IntrumentationBackend( 459): Added:'Press', with key:'press'
I/IntrumentationBackend( 459): Added:'WaitForViewById', with key:'wait_for_view_by_id'
I/IntrumentationBackend( 459): Added:'Wait', with key:'wait'
I/IntrumentationBackend( 459): Added:'WaitForDialogClose', with key:'wait_for_dialog_to_close'
I/IntrumentationBackend( 459): Added:'WaitForProgress', with key:'wait_for_no_progress_bars'
I/IntrumentationBackend( 459): Added:'WaitForScreen', with key:'wait_for_screen'
I/IntrumentationBackend( 459): Added:'WaitForText', with key:'wait_for_text'
I/IntrumentationBackend( 459): Added:'DumpBodyHtml', with key:'dump_body_html'
I/IntrumentationBackend( 459): Added:'DumpHtml', with key:'dump_html'
I/IntrumentationBackend( 459): Added:'EnterTextByCssSelector', with key:'enter_text_by_selector'
I/IntrumentationBackend( 459): Added:'PressByCssSelector', with key:'click_by_selector'
I/IntrumentationBackend( 459): Added:'Query', with key:'query'
I/IntrumentationBackend( 459): Added:'ScrollTo', with key:'scroll_to'
I/IntrumentationBackend( 459): Added:'SetPropertyByCssSelector', with key:'set_property_by_css_selector'
I/IntrumentationBackend( 459): Added:'SetText', with key:'set_text'
I/IntrumentationBackend( 459): Added:'Touch', with key:'touch'
I/global ( 459): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
D/asset ( 459): Data exceeds UNCOMPRESS_DATA_MAX (2208949 vs 1048576)
W/System.err( 459): java.io.IOException
W/System.err( 459): at android.content.res.AssetManager.readAsset(Native Method)
W/System.err( 459): at android.content.res.AssetManager.access$700(AssetManager.java:36)
W/System.err( 459): at android.content.res.AssetManager$AssetInputStream.read(AssetManager.java:574)
W/System.err( 459): at java.io.InputStreamReader.read(InputStreamReader.java:275)
W/System.err( 459): at java.io.BufferedReader.fillBuf(BufferedReader.java:155)
W/System.err( 459): at java.io.BufferedReader.readLine(BufferedReader.java:386)
W/System.err( 459): at sh.calaba.instrumentationbackend.TestHelpers.loadIds(Unknown Source)
W/System.err( 459): at sh.calaba.instrumentationbackend.InstrumentationBackend.setUp(Unknown Source)
W/System.err( 459): at junit.framework.TestCase.runBare(TestCase.java:125)
W/System.err( 459): at junit.framework.TestResult$1.protect(TestResult.java:106)
W/System.err( 459): at junit.framework.TestResult.runProtected(TestResult.java:124)
W/System.err( 459): at junit.framework.TestResult.run(TestResult.java:109)
W/System.err( 459): at junit.framework.TestCase.run(TestCase.java:118)
W/System.err( 459): at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
W/System.err( 459): at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
W/System.err( 459): at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:520)
W/System.err( 459): at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)
I/IntrumentationBackend( 459): Waiting for connection from Cucumber
I/global ( 459): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
I/System.out( 459): CommandString:{"arguments":["Sign in",true],"command":"assert_text"}
I/IntrumentationBackend( 459): Got command:'Command:'Line:null,assert_text', arguments:'[Sign in, true]'
D/dalvikvm( 459): GREF has increased to 201
D/dalvikvm( 473): GC_FOR_MALLOC freed 3686 objects / 384920 bytes in 241ms
D/dalvikvm( 459): GC_FOR_MALLOC freed 7985 objects / 561680 bytes in 110ms
I/IntrumentationBackend( 459): Result:Success: true, message:
I/System.out( 459): CommandString:{"arguments":["home_messages_label"],"command":"click_on_view_by_id"}
I/IntrumentationBackend( 459): Got command:'Command:'Line:null,click_on_view_by_id', arguments:'[home_messages_label]'
I/System.out( 459): getViewById: Looking for view home_messages_label as id null
W/System.err( 459): java.lang.RuntimeException: getViewById: Looking for view home_messages_label which does not have an id
W/System.err( 459): at sh.calaba.instrumentationbackend.TestHelpers.getViewById(Unknown Source)
W/System.err( 459): at sh.calaba.instrumentationbackend.actions.view.ClickOnViewById.execute(Unknown Source)
W/System.err( 459): at sh.calaba.instrumentationbackend.Command.execute(Unknown Source)
W/System.err( 459): at sh.calaba.instrumentationbackend.InstrumentationBackend.runCommand(Unknown Source)
W/System.err( 459): at sh.calaba.instrumentationbackend.InstrumentationBackend.startInstrumentationBackend(Unknown Source)
W/System.err( 459): at sh.calaba.instrumentationbackend.InstrumentationBackend.testHook(Unknown Source)
W/System.err( 459): at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err( 459): at java.lang.reflect.Method.invoke(Method.java:521)
W/System.err( 459): at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:204)
W/System.err( 459): at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:194)
W/ActivityManager( 73): Activity destroy timeout for HistoryRecord{44efe720 com.ebay.mobile/.activities.TermsOfUseActivity}
W/ActivityManager( 73): Activity destroy timeout for HistoryRecord{44ed90c0 com.ebay.mobile/.activities.eBay}
W/System.err( 459): at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:186)
W/System.err( 459): at junit.framework.TestCase.runBare(TestCase.java:127)
W/System.err( 459): at junit.framework.TestResult$1.protect(TestResult.java:106)
W/System.err( 459): at junit.framework.TestResult.runProtected(TestResult.java:124)
W/System.err( 459): at junit.framework.TestResult.run(TestResult.java:109)
W/System.err( 459): at junit.framework.TestCase.run(TestCase.java:118)
W/System.err( 459): at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
W/System.err( 459): at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
W/System.err( 459): at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:520)
W/System.err( 459): at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)
I/IntrumentationBackend( 459): Result:Success: false, message: getViewById: Looking for view home_messages_label which does not have an id
D/dalvikvm( 473): GC_FOR_MALLOC freed 4550 objects / 285760 bytes in 122ms
D/dalvikvm( 473): GC_FOR_MALLOC freed 1461 objects / 212896 bytes in 69ms
D/dalvikvm( 473): GC_FOR_MALLOC freed 26 objects / 185368 bytes in 46ms
D/dalvikvm( 473): GC_FOR_MALLOC freed 15 objects / 163328 bytes in 116ms
I/dalvikvm-heap( 473): Grow heap (frag case) to 3.727MB for 188434-byte allocation
D/dalvikvm( 473): GC_FOR_MALLOC freed 0 objects / 0 bytes in 127ms
D/dalvikvm( 473): GC_FOR_MALLOC freed 2476 objects / 380832 bytes in 70ms
I/IntrumentationBackend( 459): Cucumber disconnected
I/System.out( 459): Finishing
I/appLifecycle( 459): com.ebay.mobile.activities.eBay.onPause() - eBay.java:476
W/InputManagerService( 73): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@45152880 (uid=10037 pid=459)
W/ActivityManager( 73): Duplicate finish request for HistoryRecord{44f4ba70 com.ebay.mobile/.activities.eBay}
D/dalvikvm( 459): GC_EXPLICIT freed 11373 objects / 539032 bytes in 703ms
D/dalvikvm( 459): GC_EXPLICIT freed 110 objects / 4528 bytes in 117ms
I/appLifecycle( 459): com.ebay.mobile.activities.eBay.onStop() - com.ebay.mobile.activities.BaseActivity
I/appLifecycle( 459): com.ebay.mobile.activities.eBay.onDestroy() - eBay.java:526
I/TestRunner( 459): finished: testHook(sh.calaba.instrumentationbackend.InstrumentationBackend)
I/TestRunner( 459): passed: testHook(sh.calaba.instrumentationbackend.InstrumentationBackend)
I/ActivityManager( 73): Force stopping package com.ebay.mobile uid=10037
W/ActivityManager( 73): Scheduling restart of crashed service com.ebay.mobile/.mftd.MftdService in 5000ms
I/Process ( 73): Sending signal. PID: 473 SIG: 9
I/Process ( 73): Sending signal. PID: 459 SIG: 9
D/AndroidRuntime( 450): Shutting down VM
I/ActivityManager( 73): Force finishing activity HistoryRecord{44f4ba70 com.ebay.mobile/.activities.eBay}
W/ActivityManager( 73): Duplicate finish request for HistoryRecord{44f4ba70 com.ebay.mobile/.activities.eBay}
D/jdwp ( 450): Got wake-up signal, bailing out of select
D/dalvikvm( 450): Debugger has detached; object registry had 1 entries
W/ActivityManager( 73): Activity destroy timeout for HistoryRecord{44f4ba70 com.ebay.mobile/.activities.eBay}

from calabash-android.

jonasmaturana avatar jonasmaturana commented on August 17, 2024

Hm, did you run calabash-android build with this exact binary?
If not, try to run it again and run the Calabash test again.

The ids are injected into the test server when we build it. That means you have to rebuild the test server if the apk changes.
This might seem a bit strange, but it is done so that we can black box test obfuscated apps which is not possible if we use the Robotium approach.

from calabash-android.

atcrao avatar atcrao commented on August 17, 2024

.calabash_settings has the path to the apk. I did run "calabash-android build" followed by "calabash-android run --guess".
The apk is not changed and these id's exists for a while.

After downloading the latest gem, I noticed the below error. Of-couse the id based click never worked for me, even with older versions of calabash-android.

Shall I forward the apk and the features directory for you to take a quick look.

Then I press view with id "text_search_field" # calabash-android-0.0.17/lib/calabash-android/steps/press_button_steps.rb:13
undefined method exists?' for Dir:Class (NoMethodError) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/timeout.rb:62:intimeout'
features/my_first.feature:16:in `Then I press view with id "text_search_field"'

from calabash-android.

atcrao avatar atcrao commented on August 17, 2024

Jonas, can you please update or provide comments on this issue.

from calabash-android.

jonasmaturana avatar jonasmaturana commented on August 17, 2024

Please forward the apk and feature to [email protected] then I will take a look at right away.

from calabash-android.

davidgo avatar davidgo commented on August 17, 2024

I already sent you an apk previously jonas, not sure if you still have it.
I can reproduce this as well when trying to click on the buttons in the top navigation bar.

from calabash-android.

davidgo avatar davidgo commented on August 17, 2024

This seems to work fine now on 0.2.10

from calabash-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.