pyatom / pyatom

Python Automated Testing on Mac
http://pyatom.com/
GNU General Public License v2.0
376 stars 107 forks source link

OS X El Capitan(10.11): xmlrpclib fault while accessing the window list. #138

Open vraj-lifesize opened 8 years ago

vraj-lifesize commented 8 years ago

Hi Team,

I have MAC system previously running 10.10 version and i have installed the ldtp on it. I was able to access all the UI elements of our application and working fine. Recently i have updated the MAC system to 10.11 (OS X El Capitan) version , after upgrade calling 'getwindowlist()' method throwing following error.

mac.ldtp.getwindowlist() Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/dist-packages/ldtp/client.py", line 69, in call return self.send(self.name, args) File "/usr/lib/python2.7/xmlrpclib.py", line 1587, in request verbose=self.verbose File "/usr/lib/python2.7/dist-packages/ldtp/client.py", line 191, in request raise e xmlrpclib.Fault: <Fault 1: "<class 'atomac._a11y.Error'>:Error retrieving attribute (AXError -25201)">

Can you please let me know how to resolve this. Thanks.

nagappan commented 8 years ago

You can debug like this:

export LDTP_DEBUG=1 ldtpd

On another terminal run the above command and see what got printed on first terminal.

vraj-lifesize commented 8 years ago

Hi Nagappan,

Thanks for the reply. In the MAC system(system under test) in ran the following commands in one of the terminal

export LDTP_DEBUG=1 ldtp (if i try to run 'ldtpd' says, -bash: ldtpd: command not found.)

and from the remote system(linux) i am calling the ldtp.getwindowlist() method, i am seeing the following trace back in the MAC terminal.

Traceback (most recent call last): File "/Library/Python/2.7/site-packages/atomac-1.1.0-py2.7-macosx-10.8-intel.egg/atomac/ldtpd/utils.py", line 178, in _dispatch return getattr(self, method)(*args) File "/Library/Python/2.7/site-packages/atomac-1.1.0-py2.7-macosx-10.8-intel.egg/atomac/ldtpd/core.py", line 110, in getwindowlist return self._get_windows(True).keys() File "/Library/Python/2.7/site-packages/atomac-1.1.0-py2.7-macosx-10.8-intel.egg/atomac/ldtpd/utils.py", line 326, in _get_windows if not app_windows and app.AXRole == "AXApplication": File "/Library/Python/2.7/site-packages/atomac-1.1.0-py2.7-macosx-10.8-intel.egg/atomac/AXClasses.py", line 681, in getattr attr = self._getAttribute(name) Error: Error retrieving attribute (AXError -25201)

patrycjapico commented 8 years ago

Hi guys I have a similar issue while trying to run my script _atomactext.py on MAC. It was basically calling

import atomac.ldtp as ldtp print(ldtp.getobjectlist('myAppHead')) This is my stack trace: SIGUSR1 received. ldtpd ready for requests. 127.0.0.1 - - [25/Apr/2016 10:00:39] "POST /RPC2 HTTP/1.1" 200 - 127.0.0.1 - - [25/Apr/2016 10:00:39] "POST /RPC2 HTTP/1.1" 200 - (...) 127.0.0.1 - - [25/Apr/2016 10:00:40] "POST /RPC2 HTTP/1.1" 200 - Traceback (most recent call last): File "build/bdist.macosx-10.11-intel/egg/atomac/ldtpd/utils.py", line 178, in _dispatch return getattr(self, method)(*args) File "build/bdist.macosx-10.11-intel/egg/atomac/ldtpd/core.py", line 244, in getobjectlist window_handle, name, app=self._get_window_handle(window_name, True) File "build/bdist.macosx-10.11-intel/egg/atomac/ldtpd/utils.py", line 483, in _get_window_handle windows=self._get_windows() File "build/bdist.macosx-10.11-intel/egg/atomac/ldtpd/utils.py", line 326, in _get_windows if not app_windows and app.AXRole == "AXApplication": File "build/bdist.macosx-10.11-intel/egg/atomac/AXClasses.py", line 681, in getattr attr = self._getAttribute(name) Error: Error retrieving attribute (AXError -25201)

127.0.0.1 - - [25/Apr/2016 10:00:41] "POST /RPC2 HTTP/1.1" 200 - Traceback (most recent call last): File "atomac_test.py", line 7, in print(ldtp.getobjectlist(appHead)) File "build/bdist.macosx-10.11-intel/egg/atomac/ldtp/client.py", line 74, in call File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1599, in request verbose=self.verbose File "build/bdist.macosx-10.11-intel/egg/atomac/ldtp/client.py", line 195, in request xmlrpclib.Fault: <Fault 1: "<class 'atomac._a11y.Error'>:Error retrieving attribute (AXError -25201)">

Would you help me out with that one please ?

AndyAPico commented 8 years ago

Well the issues is caused by the new system integrity protection (SIP) introduced in El Capitan, while it's no perfect solution disabling it allows your old tests to run as they used too. While I am no expert on the security situation of OS X it feels like there should be a more legitimate work around as the Apple Script equivalents still function just the same proving it is possible even if you have to generate apple script then execute it. Likewise if the security is kicking in as you are trying to access a protected application it is viable that you could embed the UI test into the application in question (assuming you ofc have the source code) but that really seems like too much work for such a simple task. Again I am no expert so I am kinda just shooting in the dark and as we have a workaround available with disabling SIP I can't really justify any more of my companies development time on this issue. That's all I have, I will stay subscribed to this issue in case a more permanent work around is posted but until then good luck.

subaprasanna commented 8 years ago

hi All i am facing the same problem with 10.10 latest and 10.11 ... if any one has any solution please let us know ..

regards subs

ritikm commented 7 years ago

Hi all, I'm experiencing the same issue on 10.11. I've disabled SIP but no luck. Is there any workaround?

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/rmalhotra/.virtualenvs/donkeykong/lib/python2.7/site-packages/atomac/ldtp/client.py", line 74, in __call__
    return self.__send(self.__name, args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1599, in __request
    verbose=self.__verbose
  File "/Users/rmalhotra/.virtualenvs/donkeykong/lib/python2.7/site-packages/atomac/ldtp/client.py", line 195, in request
    raise e
xmlrpclib.Fault: <Fault 1: "<class 'atomac._a11y.Error'>:Error retrieving attribute (AXError -25201)">
suresh1227 commented 7 years ago

Hi,

i am facing same issue. any help on this

Regards Suresh.R

subaprasanna commented 7 years ago

hi Suresh You need to re copy the pyatom master using the latest version of xcode .. then it will work

suresh1227 commented 7 years ago

Hi subaprasanna

Thanks for response can you tell me what is pyatom master . I downloaded pyatom in mac using easy_install please help me on this

Regards Suresh

On Nov 23, 2016 22:21, "subaprasanna" notifications@github.com wrote:

hi Suresh You need to re copy the pyatom master using the latest version of xcode .. then it will work

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pyatom/pyatom/issues/138#issuecomment-262570221, or mute the thread https://github.com/notifications/unsubscribe-auth/ATn9uNxlSCD2r8R26RQCE2EIi-Nsl9pLks5rBG8agaJpZM4HKQ-7 .

suresh1227 commented 7 years ago

Hi subaprasanna,

I am new to this please help me i downloaded easy_install and written some basic scripts.

Please tell me where is paytom master file. or just i need to user xcode and copy automation folder to some other palce i am not getting actually.

Regards Suresh.R

On Thu, Nov 24, 2016 at 12:37 PM, suresh babu vipanchi12@gmail.com wrote:

Hi subaprasanna

Thanks for response can you tell me what is pyatom master . I downloaded pyatom in mac using easy_install please help me on this

Regards Suresh

On Nov 23, 2016 22:21, "subaprasanna" notifications@github.com wrote:

hi Suresh You need to re copy the pyatom master using the latest version of xcode .. then it will work

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pyatom/pyatom/issues/138#issuecomment-262570221, or mute the thread https://github.com/notifications/unsubscribe-auth/ATn9uNxlSCD2r8R26RQCE2EIi-Nsl9pLks5rBG8agaJpZM4HKQ-7 .