-
Notifications
You must be signed in to change notification settings - Fork 369
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
calabash - intermittent uia failures - "a JSON text must at least contain two octets!" #259
Comments
Today I ran about 6.5 hours of tests:
The tests involved lot's of typing + comparing and (of course) lot's of touching. I encountered only one Unfortunately, none of these were against an email keyboard. Next Steps
|
@jmoody Can you update this? Also I'd really appreciate if you could help me reproduce this somehow. |
@krukow later today or tomorrow i am back on calabash-ios |
cannot reproduceI cannot reproduce this problem. I am running the test suite again to confirm, but after many tens of thousands of characters, I haven't seen any I have seen one case where the ',' character was not typed correctly (no text was entered). I am trying to reproduce that. NB I am running a version of calabash that includes this pull request: #258 which fixes problems on the iPad keyboard, but looking at the examples given by Niels and Riley, I don't see how the pull request could have 'fixed' their problem. methodologyI started by trying to enter a bunch of emails into some Briar text fields. I noticed that the 'faker' gem was not generating email addresses with numbers and letters, so I randomized the username portion of the email to contain numbers and letters. This was an attempt to reproduce the problem that Niels is seeing. I then looked at Riley's use case and saw the ',' character. I decided to test against all the keys on the email keyboard. I generated random strings using all the characters on the keyboard with the exception of '' and '·' (the large dot).
Below you can see the Scenarios I ran. environment
Scenarios
calabash-ios version
server_version
|
* added tests for issue 259 - cannot reproduce - calabash/calabash-ios#259 * updates to Rakefile - removed irb scripts in favor of rake tasks - now using ideviceinstaller to remove and deploy (removed ios-deploy) - added rake task for setting the simulator default device (WIP)
I ran the test suite described above over night and could not reproduce. |
@jmoody good work. Closing this issue. Please reopen if the issue reproduces. |
* calabash/calabash-ios#259 * calabash/calabash-ios#258 * calabash/calabash-ios#265 * calabash/calabash-ios#269 * added Reveal framework to calabash target
as of 0.9.165 this has started to appear for some users when interacting with the keyboard. |
Can you get more details - is this still an issue on 0.9.166? In this version (on the 0.9.x branch), typeString on UIA was improved to be more robust. |
I have the same crash when touching some text on the screen. It crashes sometimes when touch is performed on different text, though.
calabash-ios version 0.9.165 |
I can confirm, i was also getting this error but since moving to 166, it has now gone. Thanks! |
calabash exposed a bug in Apple's UIAutomation (divide by zero). 0.9.166 detects this bug and tries to cope with it. |
This seems to still affect 0.9.166:
|
@StCredZero - is this on the simulator or adevice? which iOS? |
Joshua, It was on the simulator. (4" iPhone, not 64-bit) iOS 7. We've rolled back to 0.9.162 and can proceed this way. --Peter On Fri, Feb 7, 2014 at 6:23 PM, Joshua Moody notifications@github.comwrote:
There's neither heaven nor hell, |
As off 0.9.166, users are still reporting problems with |
@krukow I am working on getting an example - scroll to the bottom of this forum post. thanks @JaniJegoroff project - https://github.com/JaniJegoroff/calabash-ios-example-json-issue @StCredZero Can we see the step definition for |
We get the same error on random scenarios (one out of 400) using Calabash 0.9.169. Sometimes we get |
I have the same issue as @tomquist mentioned. I have multiple scenario in one feature file. I experienced intermittent Connection refused - connect(2) (http://localhost:37265) (Errno::ECONNREFUSED) error and just now I encountered "a JSON text must at least contain two octets" I am using Calabash 0.9.169 as well. |
I am experiencing the issue when trying to use typeString on the iPad simulator (iOS 7.1). As you can see from the debug console log tapOffset is working but not typeString. This is failing 100% of the time in the same spot for me.
When I dig into the code using the debugger this is what I see:
inside 'def uia(command,options={})' in uia.rb is failing.
and
This http method is returning 'nil' which is then failing the JSON parser. The app also crashes.
One other thing I'm pursuing is that we are using a custom UITextField that could be causing a problem. Any help you can provide would be awesome! Also I'm on calabash 0.9.168 |
It still occurs for me when I'm using running any uia commands in console. irb(main):012:0> start_test_server_in_background I tried @JaniJegoroff solution but it doesn't work. Any help is much appreciated. Thanks |
For people experiencing this bug could you please do the following: run your test suite with environment variable DEBUG=1 and DEBUG_HTTP=1 For example
If you manage to reproduce the issue look at the output for something like this: run_loop.out
now paste the contents of that file in here (or in gist.github.com and send the link) For example:
|
@krukow Should we update the http method to catch invalid JSON and throw a meaningful error instead? |
@jmoody @krukow |
@krukow We've seen this before. :( |
As previously said, I get the two errors
and
on random tests and they alternate randomly. I ran the test using
In my console I also found crash-logs for
and the process
As soon as I get the other error, I will post the corresponding log output here. |
Good trace!
@krukow Is it possible that this is related to: UIAKeyboard.typeString() cannot set value on invalid element: UIATextField? [1] |
Here's another logfile after getting the error
|
I get this error when trying a touch action on a TableViewCell 2014-08-18 20:47:57 +0000 Default: index 0 is command: uia.tapOffset('{:x 160.5, :y 523}') 2014-08-18 20:48:11 +0000 Default: index 7 is command: uia.tapOffset('{:x 92.5, :y 322.75}') |
I went into the same bug with the Error
|
We're also getting a lot of intermittent 'ECONNREFUSED' and 'two octets' errors. Here is a log of a 'two octets' error 2014-09-04 21:21:00 +0000 Default: index 0 is command: uia.tapOffset('{:x 224, :y 544}') |
Here is a log of the 'ECONNREFUSED' error: 2014-09-16 11:48:22.463 ScriptAgent[31568:3007] CLTilesManagerClient: initialize, sSharedTilesManagerClient |
Just upgraded to Calabash 10.1 and am now getting this two octets error for every test in my test suite. Here is the DEBUG log for one particular feature At the end of the trace I see a 200 OK coming back from the uia tap offset call but with no message body (presumably you are expecting JSON data here and failing to parse it, hence the error)? Any workarounds to get my tests running again? DEBUG=1 DEBUG_HTTP=1 cucumber -p ios -v features/login.feature:4
Features:
Using the ios profile... Scenario: Login with a valid username and password # features/login.feature:4 INFO: Using uia strategy: 'preferences' Starting on simulator App: /Users/Brad/Code/m.transport/src/m.transport/Core.Tests/calabash_tests/mtransportiOS.app2014-09-23 12:57:20 -0700 xcrun instruments -w "iPhone 5 (8.0 Simulator)" -D "/var/folders/_y/3l50pv116tddjltlpw1lqwz40000gn/T/run_loop20140923-7468-1f9gd2k/trace" -t "Automation" "/Users/Brad/Code/m.transport/src/m.transport/Core.Tests/calabash_tests/mtransportiOS.app" -e UIARESULTSPATH /var/folders/_y/3l50pv116tddjltlpw1lqwz40000gn/T/run_loop20140923-7468-1f9gd2k -e UIASCRIPT /var/folders/_y/3l50pv116tddjltlpw1lqwz40000gn/T/run_loop20140923-7468-1f9gd2k/_run_loop.js &> /var/folders/_y/3l50pv116tddjltlpw1lqwz40000gn/T/run_loop20140923-7468-1f9gd2k/run_loop.out ! CONNECT TO localhost:37265 {"query":"* marked:'username'","operation":{"method_name":"query","arguments":[]}} = Response HTTP/1.1 200 OK {"status_bar_orientation":"down","results":[{"text":"","rect":{"center_x":160,"y":114,"width":280,"x":20,"center_y":129,"height":30},"description":"<UITextField: 0x7eccb220; frame = (0 0; 280 30); text = ''; clipsToBounds = YES; opaque = NO; gestureRecognizers = <NSArray: 0x7f8a08b0>; layer = <CALayer: 0x7ecca360>>","id":"username","label":"","class":"UITextField","frame":{"y":0,"width":280,"x":0,"height":30}}],"outcome":"SUCCESS"} Given I am not logged in # features/step_definitions/login_steps.rb:1 POST /map HTTP/1.1 {"query":"* marked:'username'","operation":{"method_name":"setText","arguments":[""]}} = Response HTTP/1.1 200 OK {"status_bar_orientation":"down","results":["<UITextField: 0x7eccb220; frame = (0 0; 280 30); text = ''; clipsToBounds = YES; opaque = NO; gestureRecognizers = <NSArray: 0x7f8a08b0>; layer = <CALayer: 0x7ecca360>>"],"outcome":"SUCCESS"}= Request POST /map HTTP/1.1 {"query":"* marked:'username'","operation":{"method_name":"query","arguments":[]}} = Response HTTP/1.1 200 OK {"status_bar_orientation":"down","results":[{"text":"","rect":{"center_x":160,"y":114,"width":280,"x":20,"center_y":129,"height":30},"description":"<UITextField: 0x7eccb220; frame = (0 0; 280 30); text = ''; clipsToBounds = YES; opaque = NO; gestureRecognizers = <NSArray: 0x7f8a08b0>; layer = <CALayer: 0x7ecca360>>","id":"username","label":"","class":"UITextField","frame":{"y":0,"width":280,"x":0,"height":30}}],"outcome":"SUCCESS"}Sending UIA command POST /uia HTTP/1.1 {"command":"uia.tapOffset('{:x 160, :y 129}')"} = Response HTTP/1.1 200 OK ! CONNECTION CLOSED = Request ! CONNECT TO localhost:37265 Failing Scenarios: 1 scenario (1 failed) |
I am having a same issue with Foovanadil. I get 200 OK for uia.tapOffset request, but it does not proceed after that. |
@sychoeatclub I think your issue is related: |
I have updated the gem to report this as a possible application crash. If folks are still experiencing this in Xcode 6.1, please look for a crash report and include it here. |
@jmoody it is not clear to me if this can be closed? |
Thanks @jmoody It looks like my problem is fixed now. The touch gestures are not having timeouts anymore. |
@krukow I think it makes sense to close this issue because the title no longer describes the error message that appears. |
I am getting the same error on iOS 9.0, calabash 0.14.3, Xcode 6.3 The app launches then stops . Interesting that it happens only in landscape mode. My Cucumber step does is very simple which at the moment does not have any calabash code in it.
|
This does not seem like a valid configuration. iOS 9.0 on Xcode 6.3? Please open a new issue, this one has been resolved. If you are not using Xcode 7, the most recent version of Calabash (0.16.3) and run-loop (1.5.4), please update. If Xcode 7 is not an option, update your Calabash and run-loop versions. https://github.com/calabash/calabash-ios/wiki#reporting-problems If the app is crashing, please provide a crash log file. |
Thanks @jmoody I will fix this. |
Originally reported (on the forum)[http://tinyurl.com/ovwuv2u] as a problem with
uia_type_string
but I think that the real problem is with theuia
function itself; it just manifests more often when typing text.I experienced the same error using
uia_tap_offset
.No steps to reproduce.
No sample project.
The text was updated successfully, but these errors were encountered: