当前位置:网站首页>About how appium closes apps (resolved)

About how appium closes apps (resolved)

2022-07-07 13:03:00 Full stack husky

Wanyeji
Faint thunder , Cloudy sky .
But I hope the wind and rain will come , I can keep you here .


Preface
Author's brief introduction : Husky who yearns for power , You can call me Siberian Husky , One devoted to TFS - The whole stack Empowered bloggers
CSDN Blog expert certification 、 Nova plan Season 3 full stack track top_1 、 Huawei cloud sharing expert 、 Alibaba cloud expert Blogger
If there is something wrong with the knowledge of the article , Please correct me. ! Learn with you , Progress together
The motto of life : Being superior to some other man , Is not high , The true nobility is to be superior to one's former self .
If you feel the blogger's article is good , Please pay attention. 、 give the thumbs-up 、 Collect three companies to support bloggers


Column series ( Click unlock ) Learning route guidance Knowledge orientation
Python Full stack white paper Zero foundation beginner level chapter Easy to get started in an easy to understand way , Let you fall in love with Python The charm of .
Advanced Grammar Mainly around multi-threaded programming 、 Regular expression learning 、 Including project exercises close to actual combat .
Office automation Realize the automatic operation of daily office software , Save time 、 Improve office efficiency .
Automation test practice From the perspective of actual combat , One step ahead , Rapid transformation test development engineer .
Database development practice Updating
Introduction and practice of reptile Updating
Data analysis Updating
Introduction to the front +flask Full stack Updating
django+vue Full stack Updating
expand - Introduction to artificial intelligence Updating
The road to network security Stepping on a pit Record the pit encountered during learning and drilling , It is convenient for those who come from behind to catch up
Net security literacy Three days fishing , No deep understanding of the principle , It will only make you a script boy .
vulhub The loopholes in the shooting range reappear Make it easy to reproduce vulnerabilities , Let security researchers focus more on the vulnerability principle itself .
shell Programming Don't involve linux Basics , The final case will be in the direction of safety reinforcement . [ To be finished ]
WEB Vulnerability attack and defense 2021 year 9 month 3 Stop updating on , Move to safe communities such as prophet community and small secret circles
Collection of penetration tools 2021 year 9 month 3 Stop updating on , Move to safe communities such as prophet community and small secret circles
A little Engineer Test artifact - Charles Software test data packet capture analysis artifact
Test artifact - Fiddler Learn to fiddle , Learn not to stand upside down and eat , Rarefied !
Test artifact - Jmeter Not just a performance test artifact , It can also be used to build a lightweight interface automation testing framework .
RobotFrameWorkPython Automatic test tool realized , This chapter only introduces UI Automation part .
Java Realization UI automation Document written in 2016 year ,Java Realized UI automation , It still has reference significance .
MonkeyRunner There are not many application scenarios for this tool at present , The document has been deleted , Only for the sake of good typesetting .


Preface

I didn't want to throw this problem out alone and put it on a blog post , Knowledge points are single 、 Poor word count , It's easy to give a low quality evaluation after publication . But finally decided to let it out alone , Because about appium How to exit app The operation of . I am also looking for information and consulting several Automation 、 The reptile boss got the right answer .

background

We all know appium The bottom layer is a lot of webdriver Of packaging , So we set the memory element as and driver When using, it supports selenium Grammatical , So we use the inertia of the embassy , It may be closed app Operation of , It uses driver.close(), driver.closeApp(), driver.quit() These three commonly used closures driver Methods .

But these three methods , Can not be closed app The operation of .

analysis

Use dir function Check it out. driver What's the way , give the result as follows :

['AC_OFF', 'AC_ON', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__enter__', '__eq__', '__exit__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_addCommands', '_build_data_matcher', '_file_detector', '_is_remote', '_merge_capabilities', '_mobile', '_switch_to', '_unwrap_value', '_update_command_executor', '_web_element_cls', '_wrap_value', 'activate_app', 'activate_ime_engine', 'active_ime_engine', 'add_cookie', 'all_sessions', 'app_strings', 'application_cache', 'available_ime_engines', 'back', 'background_app', 'battery_info', 'capabilities', 'close', 'close_app', 'command_executor', 'context', 'contexts', 'create_web_element', 'current_activity', 'current_context', 'current_package', 'current_url', 'current_window_handle', 'deactivate_ime_engine', 'delete_all_cookies', 'delete_cookie', 'desired_capabilities', 'device_time', 'drag_and_drop', 'end_test_coverage', 'error_handler', 'events', 'execute', 'execute_async_script', 'execute_driver', 'execute_script', 'file_detector', 'file_detector_context', 'find_element', 'find_element_by_accessibility_id', 'find_element_by_android_data_matcher', 'find_element_by_android_uiautomator', 'find_element_by_android_view_matcher', 'find_element_by_android_viewtag', 'find_element_by_class_name', 'find_element_by_css_selector', 'find_element_by_custom', 'find_element_by_id', 'find_element_by_image', 'find_element_by_ios_class_chain', 'find_element_by_ios_predicate', 'find_element_by_ios_uiautomation', 'find_element_by_link_text', 'find_element_by_name', 'find_element_by_partial_link_text', 'find_element_by_tag_name', 'find_element_by_windows_uiautomation', 'find_element_by_xpath', 'find_elements', 'find_elements_by_accessibility_id', 'find_elements_by_android_data_matcher', 'find_elements_by_android_uiautomator', 'find_elements_by_android_viewtag', 'find_elements_by_class_name', 'find_elements_by_css_selector', 'find_elements_by_custom', 'find_elements_by_id', 'find_elements_by_image', 'find_elements_by_ios_class_chain', 'find_elements_by_ios_predicate', 'find_elements_by_ios_uiautomation', 'find_elements_by_link_text', 'find_elements_by_name', 'find_elements_by_partial_link_text', 'find_elements_by_tag_name', 'find_elements_by_windows_uiautomation', 'find_elements_by_xpath', 'find_image_occurrence', 'finger_print', 'flick', 'forward', 'fullscreen_window', 'get', 'get_clipboard', 'get_clipboard_text', 'get_cookie', 'get_cookies', 'get_device_time', 'get_display_density', 'get_events', 'get_images_similarity', 'get_log', 'get_performance_data', 'get_performance_data_types', 'get_screenshot_as_base64', 'get_screenshot_as_file', 'get_screenshot_as_png', 'get_settings', 'get_system_bars', 'get_window_position', 'get_window_rect', 'get_window_size', 'hide_keyboard', 'implicitly_wait', 'install_app', 'is_app_installed', 'is_ime_active', 'is_keyboard_shown', 'is_locked', 'keyevent', 'launch_app', 'location', 'lock', 'log_event', 'log_types', 'long_press_keycode', 'make_gsm_call', 'match_images_features', 'maximize_window', 'minimize_window', 'mobile', 'name', 'network_connection', 'open_notifications', 'orientation', 'page_source', 'press_button', 'press_keycode', 'pull_file', 'pull_folder', 'push_file', 'query_app_state', 'quit', 'refresh', 'remove_app', 'reset', 'save_screenshot', 'scroll', 'send_sms', 'session', 'session_id', 'set_clipboard', 'set_clipboard_text', 'set_gsm_signal', 'set_gsm_voice', 'set_location', 'set_network_connection', 'set_network_speed', 'set_page_load_timeout', 'set_power_ac', 'set_power_capacity', 'set_script_timeout', 'set_value', 'set_window_position', 'set_window_rect', 'set_window_size', 'shake', 'start_activity', 'start_client', 'start_recording_screen', 'start_session', 'stop_client', 'stop_recording_screen', 'swipe', 'switch_to', 'switch_to_active_element', 'switch_to_alert', 'switch_to_default_content', 'switch_to_frame', 'switch_to_window', 'tap', 'terminate_app', 'title', 'toggle_location_services', 'toggle_touch_id_enrollment', 'toggle_wifi', 'touch_id', 'unlock', 'update_settings', 'w3c', 'wait_activity', 'window_handles']

Solve the closure app Methods

In the above dir() The result found by the function , There is a terminate_app Method , This method requires a app_id Parameters , In fact, that is app The package name , such as Baidu APP The package name of is com.baidu.searchbox , Try this method , close app , Perfect solution .


原网站

版权声明
本文为[Full stack husky]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207071046397439.html