Touch does not respond in Calabash-ios Xcode 6.1.1 - ruby

Recently started with Calabash on iOS.
I have a simple code that does a touch("label marked:'Username'") and then uses keyboard_enter_text to enter the text, but for some reason when I run this via cucumber from command line or without setting breakpoints in Rubymine the code just runs and does not produce the desired result and the touch does not seem to do anything and the keyboard is not activated. I am doing this on a real device, (I have tried various devices).
How ever if I debug the code using ruby mine using breakpoint it produces the desired result.
I have the below setup
$ xcode-select --print-path
/Applications/Xcode.app/Contents/Developer
$ xcodebuild -version
Xcode 6.1.1
Build version 6A2008a
$ calabash-ios version
0.11.4
curl http://:37265/version
{"app_version":"4.3",
"outcome":"SUCCESS",
"app_id":"****",
"simulator_device":"",
"version":"0.11.4",
"app_name":"***",
"iphone_app_emulated_on_ipad":false,
"4inch":true,
"git":{"remote_origin":"git#github.com:calabash\/calabash-ios-server.git",
"branch":"master","revision":"bcc992b"},
"screen_dimensions":{"scale":2,"width":640,"sample":1,"height":1136},
"iOS_version":"7.1.2",
"system":"iPhone5,2","simulator":""}
I have checked that My App is linked with the correct calabash.framework and that it matches the gem version 0.11.4
When I debug using ruby mine then the steps run successfully (the touch works and the keyboard is activated), how ever when I run from command line or run without breakpoints in Ruby mine, the touch just seems to fail without issuing any warnings or errors. Not sure what is causing it, I have upgraded from Xcode 6.1 to Xcode 6.1.1 and that too did not help.
I have noticed similar issues reported by people in the past, but they have been around older versions of the calabash iOS gem and supposed to have been fixed in 0.11.4
When I run the app in DEBUG mode with DEBUG=1 and HTTP_DEBUG=1 I can see below
Command line run in which touch does not do anything
`
! CONNECT TO <ip>:37265
! CONNECTION ESTABLISHED
POST /map HTTP/1.1
Content-Type: application/x-www-form-urlencoded
User-Agent: HTTPClient/1.0 (2.3.4.1, ruby 2.1.5 (2014-11-13))
Accept: */*
Date: Fri, 27 Feb 2015 16:19:55 GMT
Content-Length: 97
Host: <ip>:37265
{"query":"view marked:'Problems signing in?'","operation":{"method_name":"query","arguments":[]}}
= Response
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Length: 66
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Date: Fri, 27 Feb 2015 16:19:56 GMT
Accept-Ranges: bytes
Access-Control-Max-Age: 3000
{"status_bar_orientation":"down","results":[],"outcome":"SUCCESS"}
`
Debug run from ruby mine using breakpoint
CONNECT TO <ip>:37265
! CONNECTION ESTABLISHED
POST /map HTTP/1.1
Content-Type: application/x-www-form-urlencoded
User-Agent: HTTPClient/1.0 (2.3.4.1, ruby 1.9.3 (2013-06-27))
Accept: */*
Date: Fri, 27 Feb 2015 16:18:07 GMT
Content-Length: 97
Host: <ip>:37265
{"query":"view marked:'Problems signing in?'","operation":{"method_name":"query","arguments":[]}}
= Response
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Length: 478
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Date: Fri, 27 Feb 2015 16:18:08 GMT
Accept-Ranges: bytes
Access-Control-Max-Age: 3000
{"status_bar_orientation":"down","results":[{"text":"Problems signing in?","enabled":true,"rect":{"center_x":160,"y":504,"width":200,"x":60,"center_y":526,"height":44},"id":null,"description":"<UILabel: 0x14dde8d0; frame = (60 504; 200 44); text = 'Problems signing in?'; gestureRecognizers = <NSArray: 0x14dde1f0>; layer = <CALayer: 0x14dde980>>","label":"Problems signing in?","alpha":1,"class":"UILabel","frame":{"y":504,"width":200,"x":60,"height":44}}],"outcome":"SUCCESS"}= Request
`
As we can see the debug run in Rubymine seems to return information about frame ordinates that are missing in the first run
The log output at /var/folders/25/9_sb609576jcmgdbqt553ps08n5b5c/T/run_loop20150227-8208-1g7ccvv/run_loop.out for the failed run
2015-02-27 16:19:51.871 instruments[8229:591f] WebKit Threading Violation - initial use of WebKit from a secondary thread.
2015-02-27 16:19:56 +0000 Default: OUTPUT_JSON:
{"status":"success","value":true,"index":0}
END_OUTPUT
And for the successful debug run (that activated the touch and the keyboard) at /var/folders/25/9_sb609576jcmgdbqt553ps08n5b5c/T/run_loop20150227-7941-1c6mznp/run_loop.out
2015-02-27 16:18:00.085 instruments[7962:4f17] WebKit Threading Violation - initial use of WebKit from a secondary thread.
2015-02-27 16:18:04 +0000 Default: OUTPUT_JSON:
{"status":"success","value":true,"index":0}
END_OUTPUT
The run_loop.out does not seem to give any indication either.
Am I missing something ? Why does the touch not have any effect and not activate the keyboard. Any help is appreciated.

I have a couple of suggestions. These are not definitive answers, but the text is too long for a comment.
I have noticed similar issues reported by people in the past, but they have been around older versions of the calabash iOS gem and supposed to have been fixed in 0.11.4
Can you update your gem and server to the latest 0.13.0? There have been many fixes since 0.11.4.
Is it possible that you are seeing this: NSLog output can cause apps to become unresponsive during testing.?
works when debugging
I suspect this is because of timing issue, but I cannot confirm until I see some Steps or a list of commands executed in the irb.

Related

VLC : which file to update VLC Lua youtube script on Mac OS X?

I am trying to read a youtube video through VLC on my mac:
/Applications/VLC.app/Contents/MacOS/VLC -v https://www.youtube.com/watch?v=afzmwAKUppU&app=desktop
Which gives errors :
VLC media player 3.0.
8 Vetinari (revision 3.0.8-0-gf350b6b5a7)
[00007faf5b5e9140] lua generic warning: Error while running script /Applications/VLC.app/Contents/MacOS/share/lua/extensions/youtube.lua, function descriptor() not found
[00007faf5b4589c0] macosx interface warning: Failed to enable media key support, likely app needs to be whitelisted in Security Settings.
[00007faf5b784950] securetransport tls client warning: Ignoring ALPN request due to lack of support in the backend. Proxy behavior potentially undefined.
[00007faf5b770200] lua stream warning: Couldn't extract video URL, falling back to alternate youtube API
[00007faf5b6b5b60] securetransport tls client warning: Ignoring ALPN request due to lack of support in the backend. Proxy behavior potentially undefined.
[00007faf5f97ce70] securetransport tls client warning: Ignoring ALPN request due to lack of support in the backend. Proxy behavior potentially undefined.
2020-10-15 13:45:28.281 VLC[65658:198319] Can't find app with identifier com.spotify.client
[00007faf5b5d8580] lua stream error: Couldn't extract youtube video URL, please check for updates to this script
[00007faf5b44b570] main playlist: playlist is empty
The youtube.lua, I got it by downloading the file from internet :
curl "http://git.videolan.org/?p=vlc.git;a=blob_plain;f=share/lua/playlist/youtube.lua;hb=HEAD" -o /Applications/VLC.app/Contents/MacOS/share/lua/extensions/youtube.lua
Which works on my ubuntu, but not in my Mac: I am wondering if this is not the correct version for Mac OS. And so, which file should be put there ?
If I look on the VLC Lua directory, I find :
/Applications/VLC.app/Contents/MacOS/share/lua/extensions$ ls -l
total 192
-rw-r--r--# 1 romain admin 72K Aug 14 2019 VLSub.luac
-rw-r--r-- 1 root admin 22K Oct 15 13:35 youtube.lua
the youtube.lua is the new script I added, but maybe it was another one to put there ?
Probably a bit late here now, but in any case:
You need to take the youtube.lua from here: https://github.com/videolan/vlc/blob/master/share/lua/playlist/youtube.lua
Then rename it to youtube.luac and place it in the directory (for MacOS) /Applications/VLC.app/Contents/MacOS/share/lua/playlist
I would recommend renaming the old one and keeping it in case something goes awry.
At least on my computer this worked and I can now open YouTube videos in VLC again.
Have you tried the 3.0.11.1 release? https://get.videolan.org/vlc/3.0.11.1/macosx/vlc-3.0.11.1.dmg
You're correct that youtube.lua would be the correct file, though the issue might come from other parts of the code depending on it. FYI, since you are running a stable VLC build, the code you should look at is https://code.videolan.org/videolan/vlc-3.0/-/blob/master/share/lua/playlist/youtube.lua.
https://code.videolan.org/videolan/vlc/-/blob/master/share/lua/playlist/youtube.lua is nightly v4 unstable builds (though for the lua script, they are identical).
Additionally, look out for a new release with an updated script soon https://mailman.videolan.org/pipermail/vlc-devel/2020-October/139076.html

Why sphinxcontib-httpdomain directive http:post is unknown?

I have trouble with sphinxcontrib-httpdomain. If i defining http get or post or any another domain, sphinx-build tells me about error
Unknown directive type "http:get"
Definition of http:post domain in my sources:
.. http:get:: /users/(int:user_id)/posts/(tag)
The posts tagged with `tag` that the user (`user_id`) wrote.
**Example request**:
.. sourcecode:: http
GET /users/123/posts/web HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
[
{
"post_id": 12345,
"author_id": 123,
"tags": ["server", "web"],
"subject": "I tried Nginx"
},
{
"post_id": 12346,
"author_id": 123,
"tags": ["html5", "standards", "web"],
"subject": "We go to HTML 5"
}
]
:query sort: one of ``hit``, ``created-at``
:query offset: offset number. default is 0
:query limit: limit number. default is 30
:reqheader Accept: the response content type depends on
:mailheader:`Accept` header
:reqheader Authorization: optional OAuth token to authenticate
:resheader Content-Type: this depends on :mailheader:`Accept`
header of request
:statuscode 200: no error
:statuscode 404: there's no user
There are two blank lines before and after this block. I tried to use 3,4 spaces and to offset contents of block
Contents of extensions block of conf.py:
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.extlinks',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.ifconfig',
'sphinx.ext.doctest',
'sphinx.ext.graphviz',
'sphinxcontrib.httpdomain'
]
What i'd tried also and it doesn't helped:
- To reinstall all sphinx* packages via pip
To reinstall all sphinx* packages via apt-get
To specify path to extension in conf.py
To reinstall all autodoc, docutils packages via pip
To build on another host (same error)
To look at build logs with -vvv mode
To read [official plugin docs][3] and do all of steps
Some information which can be useful:
All packages are installed to /usr/local/lib/python2.7/dist-packages
pip show sphinx output:
Name: Sphinx
Version: 1.6.7
Summary: Python documentation generator
Home-page: http://sphinx-doc.org/
Author: Georg Brandl
Author-email: georg#python.org
License: BSD
Location: /usr/local/lib/python2.7/dist-packages
Requires: sphinxcontrib-websupport, babel, imagesize, setuptools, typing, Pygments, requests, six, docutils, alabaster, Jinja2, snowballstemmer
pip show sphinxcontrib-httpdomain output:
Name: sphinxcontrib-httpdomain
Version: 1.6.0
Summary: Sphinx domain for documenting HTTP APIs
Home-page: https://github.com/sphinx-contrib/httpdomain
Author: Hong Minhee
Author-email: hong.minhee#gmail.com
License: BSD
Location: /usr/local/lib/python2.7/dist-packages
Requires: six, Sphinx
uname output:
Linux 4.13.0-32-generic #35-Ubuntu SMP Thu Jan 25 09:13:46 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
After fighting with this problem for a while, I finally found the solution. The version included in Debian buster and Ubuntu bionic (and newer) has a patch added which solved an issue, but added this problem.
The patch comes from this commit, but it is missing the fix added a couple of days after in this other commit.
It seems that even if you tried to install with pip, you were using the system version. You can patch it trivially by editing the code at /usr/lib/python2/dist-packages/sphinxcontrib/httpdomain.py.
I am sending the patch to the package maintainer so it hopefully will be fixed soon in unstable.

gsutil cp hangs on obtain initial access_token

When using gsutil to copy a file it hangs indefinitely:
gsutil cp gs://gcp-public-data-sentinel-2/index.csv.gz .
Running gsutil with with debugging gsutil -D cp outputs:
gsutil version: 4.28n
boto version: 2.48.0
python version: 2.7.13 |Anaconda custom (64-bit)| (default, Dec 20 2016, 23:09:15) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
OS: Linux 2.6.32-504.23.4.el6.x86_64
multiprocessing available: True
using cloud sdk: True
pass cloud sdk credentials to gsutil: True
config path(s): /home/gardnera/.config/gcloud/legacy_credentials/my#email/.boto
gsutil path: /u/devon0/gardnera/yes/google-cloud-sdk/platform/gsutil/gsutil
compiled crcmod: True
installed via package manager: False
editable install: False
Command being run: /u/devon0/gardnera/yes/google-cloud-sdk/platform/gsutil/gsutil -o GSUtil:default_project_id=landsatdata1 -D cp gs://gcp-public-data-sentinel-2/index.csv.gz /home/gardnera/
config_file_list: ['/home/gardnera/.config/gcloud/legacy_credentials/my#email.com/.boto']
config: [('debug', '0'), ('working_dir', '/mnt/pyami'), ('https_validate_certificates', 'true'), ('debug', '0'), ('working_dir', '/mnt/pyami'), ('default_project_id', 'landsatdata1')]
INFO 0110 17:16:21.952356 base_api.py] Calling method storage.objects.get with StorageObjectsGetRequest: <StorageObjectsGetRequest
bucket: u'gcp-public-data-sentinel-2'
object: u'index.csv.gz'
projection: ProjectionValueValuesEnum(noAcl, 1)>
INFO 0110 17:16:21.953642 base_api.py] Making http GET to https://www.googleapis.com/storage/v1/b/gcp-public-data-sentinel-2/o/index.csv.gz?fields=contentType%2Cname%2Cgeneration%2CcustomerEncryption%2Cmd5Hash%2CcontentEncoding%2Ccrc32c%2Cetag%2CmediaLink%2Csize&alt=json&projection=noAcl
INFO 0110 17:16:21.954131 base_api.py] Headers: {'accept': 'application/json',
'accept-encoding': 'gzip, deflate',
'content-length': '0',
'user-agent': 'apitools gsutil/4.28 Python/2.7.13 (linux2) google-cloud-sdk/184.0.0 analytics/disabled'}
INFO 0110 17:16:21.954305 base_api.py] Body: (none)
INFO 0110 17:16:21.954441 client.py] Attempting refresh to obtain initial access_token
but hangs indefinitely on obtain initial access_token
I've been digging into this issue for awhile now and can't seem to find any answer. Testing on other machines I am unable to replicate the issue. A reinstall of gcloud did not fix the issue.
Anyone have any thoughts as to what might be going on?
Thanks
OK looks like the problem was with the .config files. I deleted the ~/.config/gcloud folder and the issue has resolved itself

Retrieving original headers using Outlook Redemption

I'm working on a piece of Outlook automation that takes mail placed in a specific folder and exports it as an RFC822 formatted mail message. This output file will then be fed to the SpamAssassin tool sa-learn.exe.
For Each oItem In oFolder.Items
If TypeOf oItem Is RDOMail Then
Set oMailItem = oItem
' Deptermine the fully qualified path to save the file
sFilePath = GetFilePath(oMailItem, "//Mailbox/SpamAssassin/Spam")
'Save the RFC822 format message
oMailItem.SaveAs sFilePath, rdoSaveAsType.olRFC822
DoEvents
oMailItem.UnRead = False
oMailItem.Delete
End If
DoEvents 'Let the Outlook UI thread breathe a bit
Next 'for each
Here are the message headers from a message saved using this code with redacted e-mail addresses.
From: "Swift Learning" <**********#***.*************.***>
To: <*****#********.***>
Subject: Foreign Languages are easily learned in this program
Date: Tue, 31 Jul 2012 10:11:38 -0700
Message-ID: <8518205138200566845#smx.jacksonpotts2.com>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_13AE_01CD6F0A.C9624870"
X-Mailer: Microsoft Outlook 14.0
Thread-Index: AQF4Lq/07oPqx1sKGPa5FKQSalUQXg==
What's missing from this are the relay headers that should look something like this.
Received: from [216.104.163.151] by mail.clarkzoo.org (ArGoSoft Mail Server .NET v.1.0.8.4) with ESMTP (EHLO smtp02-forward-1.daemonmail.net)
for <*****#*********.***>; Tue, 31 Jul 2012 12:36:25 -0700
Received: from mxw03.daemonmail.net (unknown [216.104.161.13])
by smtp02-forward-1.daemonmail.net (Postfix) with ESMTP id 4447681FDB;
Tue, 31 Jul 2012 12:18:01 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
by mxw03.daemonmail.net (Postfix) with ESMTP id 748CF6A0DD
for <***#******************.***>; Tue, 31 Jul 2012 12:17:52 -0700 (PDT)
How can I capture those relay headers?
Update:
Looking into this further, the raw headers as stored in the MailItem in Outlook are radically different from the RFC822 format as saved by Redemption.
Here's a side by side comparion.
Raw headers from the Properties dialog in Outlook.
Received: from [108.174.54.7] by mail.clarkzoo.org (ArGoSoft Mail Server .NET v.1.0.8.4) with ESMTP (EHLO upgraded.the-ameri-credit-review.com)
for <*****#********.***>; Wed, 01 Aug 2012 07:34:15 -0700
Date: Wed, 1 Aug 2012 09:55:57 -0400
Subject: Your TransUnion, Equifax, and Experian Scores May Have Changed
From: "Credit Check" <info#the-ameri-credit-review.com>
To: <*****#********.***>
Message-ID: <132692318349a4a4158c108651c1428c#upgraded.the-ameri-credit-review.com>
Mime-Version: 1.0
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
SPF-Received: softfail
X-FromIP: 108.174.54.7
The headers from the RFC822 formatted file:
From: "Credit Check" <info#the-ameri-credit-review.com>
To: <*****#********.***>
Subject: Your TransUnion, Equifax, and Experian Scores May Have Changed
Date: Wed, 1 Aug 2012 06:55:57 -0700
Message-ID: <132692318349a4a4158c108651c1428c#upgraded.the-ameri-credit-review.com>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_011B_01CD6FC4.403990C0"
X-Mailer: Microsoft Outlook 14.0
Thread-Index: AQIRB+hjg86/OeRgMx9VYijSdeLwhw==
Those headers are only superficially the same.
The relay headers are missing
Date and Subjects are in different positions
Date header has been be modified to repressent local time zone
Content-Type has changed from "text/html; charset=us-ascii" to "multipart/alternative;"
Headers have been added and headers have been removed
The better question is how does one capture the original headers of the message?
I know this is an old post but try saving as rdoSaveAsType.olRFC822_Redemption instead of rdoSaveAsType.olRFC822. It seems to preserve all of the headers.

Perl script are not running on Apache 2.2.15 with mod_fcgid / Win32

I have installed apache 2.2.15 with mod_fcgid on Windows XP SP3 and Activestate Perl (tried both 5.12 & 5.8.9)
tried the perl example script in the mod_fcgid reference page but it
is not working
I get this in error log
[Tue Dec 07 23:10:35 2010] [info] mod_fcgid: server 127.0.0.1:/usr/bin/perl.exe(5476) started
[Tue Dec 07 23:10:35 2010] [warn] [client 127.0.0.1] (OS 109)The pipe has been ended. : mod_fcgid : get overlap result error
[Tue Dec 07 23:10:35 2010] [error] [client 127.0.0.1] Premature end of script headers: f.pl
[Tue Dec 07 23:10:35 2010] [error] [client 127.0.0.1] File does not exist: C:/Apache2/htdocs/favicon.ico
[Tue Dec 07 23:10:39 2010] [info] mod_fcgid - infoneto: process /usr/bin/perl.exe(5476) exit(communication error), return code 9
I double check everything including:
The #!/usr/bin/perl.exe line
The mod_fcgid is loaded
When running the script as plain cgi it works
When I turned to the older mod_fastcgi it works just fine as a fastcgi (i.e. loads once runs many times).
Using process monitor I can see that apache starts Perl but it Perl exits almost instantly without even loading the Perl script
I tried it also on Apache 2.0.52 & 2.0.63 with older mod_fcgid and with Apache 2.2.15 with the newest mod_fcgid (2.3.6) but no luck
What can be done ?
I googled around but no one seems to have solution or managed using mod_fcgid with perl on Win32
I opened a bug on both FCGI at cpan and on apache tracker but no one seems to care...
Is there a solution for this ?
Does someone else need this ? (mod_fcgid with Perl on Apache/Win32)
You're on Win32, and you have a /usr/bin/perl.exe? Are you sure?
Regardless, I think you're looking for mod_fastcgi rather than mod_fcgid; at least, a quick google search seemed that it fixed the problem for most. Apparently mod_fcgid is not working as well under Windows.

Resources