def test_something(): application = Application.Launch('c:\\Program Files (x86)\\GAS Softwares\\Free Address Book\\AddressBook.exe') main_window = application.GetWindow("Free Address Book") main_window.Get(SearchCriteria.ByAutomationId("groupButton")).Click() modal = main_window.ModalWindow('Group editor') modal.Get(SearchCriteria.ByAutomationId("uxCloseAddressButton")).Click() main_window.Get(SearchCriteria.ByAutomationId("uxExitAddressButton")).Click()
def launch_application(self, sut_path, args=None): """Launches an application. ``sut_path`` is the absolute path to the application to launch. ``args`` is a string of arguments to use when starting the application (optional). Examples: | Launch Application | C:/path/to/MyApp.exe | | # Launch without arguments | | Launch Application | C:/path/to/MyApp.exe | /o log.txt | # Launch with arguments | """ if args is not None: process_start_info = ProcessStartInfo(sut_path) process_start_info.Arguments = args self.state.app = Application.Launch(process_start_info) else: self.state.app = Application.Launch(sut_path)
def test_something(): application = Application.Launch("C:\\Program Files (x86)\\GAS Softwares\\Free Address Book\\AddressBook.exe") main_window = application.GetWindow("Free Address Book") old_list = get_group_list(main_window) add_new_group(main_window, 'test group') new_list = get_group_list(main_window) old_list.append('test group') assert sorted(old_list) == sorted(new_list) main_window.Get(SearchCriteria.ByAutomationId("uxExitAddressButton")).Click()
def test_1(): application = Application.Launch("C:\\addressbook_exe\\AddressBook.exe") main_window = application.GetWindow("Free Address Book") old_list = get_group_list(main_window) add_new_group(main_window, 'test group') new_list = get_group_list(main_window) old_list.append('test group') assert sorted(old_list) == sorted(new_list) main_window.Get( SearchCriteria.ByAutomationId("uxExitAddressButton")).Click()
def test_something(): application = Application.Launch( "c:\\Tools\\AppsForTesting\\AddressbookNative4\\AddressBook.exe") main_window = application.GetWindow("Free Address Book") old_list = get_group_list(main_window) add_new_group(main_window, 'test group') new_list = get_group_list(main_window) old_list.append('test group') assert sorted(old_list) == sorted(new_list) main_window.Get( SearchCriteria.ByAutomationId("uxExitAddressButton")).Click()
def test_something(): application = Application.Launch( "C:\\Program Files (x86)\\GAS Softwares\\Free Address Book\\AddressBook.exe" ) main_window = application.GetWindow("Free Address Book") main_window.Get(SearchCriteria.ByAutomationId("groupButton")).Click() modal = main_window.ModalWindow("Group editor") modal.Get(SearchCriteria.ByAutomationId("uxNewAddressButton")).Click() modal.Get(SearchCriteria.ByControlType( ControlType.Edit)).Enter('test group') Keyboard.Instance.PressSpecialKey(KeyboardInput.SpecialKeys.RETURN) time.sleep(10) modal.Get(SearchCriteria.ByAutomationId("uxCloseAddressButton")).Click() main_window.Get( SearchCriteria.ByAutomationId("uxExitAddressButton")).Click()
def test_smth(): Application.Launch("notepad.exe") print("ok")
def test_something(): application = Application.Launch("iexplore.exe") main_window = application.GetWindow('Free Address Book') print('ok')
#IronPython case use other .NET testing framework like MS UI Automation or White import sys import os import clr clr.AddReferenceToFile("nautoit.dll") clr.AddReferenceToFile("TestStack.White.dll") from nautoit import au from TestStack.White import Application from TestStack.White.InputDevices import Keyboard application = Application.Launch("notepad.exe"); window = application.GetWindow("Untitled - Notepad"); window.Focus() Keyboard.Instance.Enter("This is some text."); window.Close() #Allows step by step migration from AutoIt to anything else close = au.WinWaitActive("Notepad", "Save") au.Send("!n")
def launch_application(self, sut_path): self.state.app = Application.Launch(sut_path)
def launch_application(app_path): application = Application.Launch(app_path) main_window = application.GetWindow("Free Address Book") return main_window
def __init__(self, path): self.application = Application.Launch(path) self.main_window = self.application.GetWindow("Free Address Book") self.group = GroupHelper(self)
def __init__(self, path_to_app, main_window_header): self.application = Application.Launch(path_to_app) self.group = GroupHelper(self) self.main_window_header = main_window_header
def test_something(): Application.Launch("notepad.exe") print("ok")
def __init__(self, appname): self.application = Application.Launch(appname) self.main_window = self.application.GetWindow("Free Address Book")
def __init__(self, base_address): self.group = GroupHelper(self) application = Application.Launch(base_address) self.main_window = application.GetWindow("Free Address Book")
def __init__(self): self.group = GroupHelper(self) self.application = Application.Launch( "C:\\Program Files (x86)\\GAS Softwares\\Free Address Book\\AddressBook.exe" ) self.main_window = self.application.GetWindow("Free Address Book")