Best Python code snippet using pyatom_python
__init__.py
Source:__init__.py
1# Copyright (c) 2017 VMware, Inc; AO Kaspersky Lab. All Rights Reserved.2# This file is part of ATOMac.3# ATOMac is free software; you can redistribute it and/or modify4# it under the terms of the GNU General Public License as published by the Free5# Software Foundation version 2 and no later version.6# ATOMac is distributed in the hope that it will be useful, but7# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or8# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License version 29# for more details.10# You should have received a copy of the GNU General Public License along with11# this program; if not, write to the Free Software Foundation, Inc., 51 Franklin12# St, Fifth Floor, Boston, MA 02110-1301 USA.13# noinspection PyUnresolvedReferences14from ._a11y import Error, ErrorAPIDisabled, ErrorInvalidUIElement, \15 ErrorCannotComplete, ErrorUnsupported, ErrorNotImplemented16from .AXClasses import NativeUIElement17from .Clipboard import Clipboard18from .version import __version__19from .Prefs import Prefs20getAppRefByLocalizedName = NativeUIElement.getAppRefByLocalizedName21terminateAppByBundleId = NativeUIElement.terminateAppByBundleId22launchAppByBundlePath = NativeUIElement.launchAppByBundlePath23setSystemWideTimeout = NativeUIElement.setSystemWideTimeout24getAppRefByBundleId = NativeUIElement.getAppRefByBundleId25launchAppByBundleId = NativeUIElement.launchAppByBundleId26getFrontmostApp = NativeUIElement.getFrontmostApp...
reset_ad_id.py
Source:reset_ad_id.py
2from AppKit import NSWorkspace3from Foundation import NSURL4import atomac5try:6 atomac.getAppRefByLocalizedName('System Preferences')7except ValueError:8 sys_pref_link = 'x-apple.systempreferences:com.apple.preference.security?Privacy_Advertising'9 workspace = NSWorkspace.sharedWorkspace()10 workspace.openURL_(NSURL.URLWithString_(sys_pref_link))11pref = atomac.getAppRefByLocalizedName('System Preferences')12win = pref.AXFocusedWindow13win.findAllR(AXRole='AXButton', AXTitle='Reset Advertising Identifier')[0].Press()...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!