Skip to content

Mac HighSierra - Interacting with SecurityAgent does not work most of the times #156

Description

Code

>>> import atomac
>>> context = atomac.getAppRefByBundleId('com.apple.SecurityAgent')
>>> print context
<atomac.AXClasses.NativeUIElement AXApplication u'SecurityAgent'>
>>> context.findFirstR(AXRole='AXButton')
>>> b =context.findFirstR(AXRole='AXButton')
>>> print b

None

After trying a couple of times, it magically worked, and then stopped working again.

>>> import atomac
>>> context = atomac.getAppRefByBundleId('com.apple.SecurityAgent')
>>> print context
<atomac.AXClasses.NativeUIElement AXApplication u'SecurityAgent'>
>>> context.findFirstR(AXRole='AXButton')
<atomac.AXClasses.NativeUIElement AXButton u'Cancel'>
>>> context.findFirstR(AXRoleDescription='secure text field')
<atomac.AXClasses.NativeUIElement AXTextField u''>
>>> tf = context.findFirstR(AXRoleDescription='secure text field')
>>> tf.sendKeys('a')
>>> context.findFirstR(AXRole='AXButton', AXTitle='OK')
<atomac.AXClasses.NativeUIElement AXButton u'OK'>
>>> btn = context.findFirstR(AXRole='AXButton', AXTitle='OK')
>>> print btn
<atomac.AXClasses.NativeUIElement AXButton u'OK'>
>>> exit()

Is this a bug in atomac?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions