Best Python code snippet using AutoItDriverServer_python
call_settings.py
Source:call_settings.py
...86 return self.marionette.find_element(*self._passcode_page_locator)87 def tap_sim_1(self):88 element = self.marionette.find_element(*self._sim_1_locator)89 Wait(self.marionette).until(expected.element_displayed(element) and90 expected.element_enabled(element))91 element.tap()92 Wait(self.marionette).until(expected.element_displayed(93 *self._call_settings_page_locator))94 def tap_voicemail(self):95 element = self.marionette.find_element(*self._voicemail_locator)96 Wait(self.marionette).until(expected.element_displayed(element) and97 expected.element_enabled(element))98 element.tap()99 Wait(self.marionette).until(expected.element_displayed(100 *self._voicemail_number_locator))101 self.marionette.switch_to_frame()102 Wait(self.marionette).until(lambda m: self.keyboard.is_keyboard_displayed)103 self.apps.switch_to_displayed_app()104 def tap_caller_id_selection(self):105 menu_item = self.marionette.find_element(*self._caller_id_menu_item_locator)106 Wait(self.marionette).until(lambda m: not menu_item.get_attribute('aria-disabled'))107 element = self.marionette.find_element(*self._caller_id_selector_locator)108 Wait(self.marionette).until(expected.element_displayed(element) and109 expected.element_enabled(element))110 element.tap()111 self.marionette.switch_to_frame()112 def confirm_caller_id_selection(self):113 element = self.marionette.find_element(*self._caller_id_confirm_button_locator)114 Wait(self.marionette).until(expected.element_displayed(element) and115 expected.element_enabled(element))116 element.tap()117 self.apps.switch_to_displayed_app()118 Wait(self.marionette).until(expected.element_displayed(*self._caller_id_selector_locator))119 def tap_fixed_dialing(self):120 element = self.marionette.find_element(*self._fixed_dialing_numbers_locator)121 Wait(self.marionette).until(expected.element_displayed(element) and122 expected.element_enabled(element))123 element.tap()124 Wait(self.marionette).until(expected.element_displayed(125 *self._fixed_dialing_page_locator))126 def enable_fixed_dialing(self):127 GaiaBinaryControl(self.marionette, self._toggle_fixed_dialing_number_locator).enable()128 Wait(self.marionette).until(expected.element_displayed(129 *self._sim_pin_area_locator))130 self.marionette.switch_to_frame()131 Wait(self.marionette).until(lambda m: self.keyboard.is_keyboard_displayed)132 self.apps.switch_to_displayed_app()133 def tap_auth_numbers(self):134 element = self.marionette.find_element(*self._auth_number_locator)135 Wait(self.marionette).until(expected.element_displayed(element) and136 expected.element_enabled(element))137 element.tap()138 Wait(self.marionette).until(expected.element_displayed(139 *self._auth_number_page_locator))140 def tap_call_forwarding(self):141 element = self.marionette.find_element(*self._call_forwarding_locator)142 Wait(self.marionette).until(expected.element_displayed(element) and143 expected.element_enabled(element))144 element.tap()145 Wait(self.marionette).until(expected.element_displayed(146 *self._call_forwarding_page_locator))147 Wait(self.marionette).until(148 expected.element_displayed(*self._call_settings_query_locator))149 # the default is 'disabled'150 def wait_until_call_forwarding_info_received(self):151 Wait(self.marionette, timeout=60).until(152 expected.element_displayed(*self._call_forwarding_status_disabled_text_locator))153 def tap_always_forward(self):154 element = self.marionette.find_element(*self._call_forwarding_always_locator)155 Wait(self.marionette).until(expected.element_displayed(element) and156 expected.element_enabled(element))157 element.tap()158 Wait(self.marionette).until(expected.element_displayed(159 *self._call_forwarding_always_page_locator))160 self.marionette.switch_to_frame()161 Wait(self.marionette).until(lambda m: self.keyboard.is_keyboard_displayed)162 self.apps.switch_to_displayed_app()163 def tap_forward_when_busy(self):164 element = self.marionette.find_element(*self._call_forwarding_busy_locator)165 Wait(self.marionette).until(expected.element_displayed(element) and166 expected.element_enabled(element))167 element.tap()168 Wait(self.marionette).until(expected.element_displayed(169 *self._call_forwarding_busy_page_locator))170 self.marionette.switch_to_frame()171 Wait(self.marionette).until(lambda m: self.keyboard.is_keyboard_displayed)172 self.apps.switch_to_displayed_app()173 def tap_forward_unanswered(self):174 element = self.marionette.find_element(*self._call_forwarding_unanswered_locator)175 Wait(self.marionette).until(expected.element_displayed(element) and176 expected.element_enabled(element))177 element.tap()178 Wait(self.marionette).until(expected.element_displayed(179 *self._call_forwarding_unanswered_page_locator))180 self.marionette.switch_to_frame()181 Wait(self.marionette).until(lambda m: self.keyboard.is_keyboard_displayed)182 self.apps.switch_to_displayed_app()183 def tap_forward_unreachable(self):184 element = self.marionette.find_element(*self._call_forwarding_unreachable_locator)185 Wait(self.marionette).until(expected.element_displayed(element) and186 expected.element_enabled(element))187 element.tap()188 Wait(self.marionette).until(expected.element_displayed(189 *self._call_forwarding_unreachable_page_locator))190 self.marionette.switch_to_frame()191 Wait(self.marionette).until(lambda m: self.keyboard.is_keyboard_displayed)192 self.apps.switch_to_displayed_app()193 def tap_call_barring(self):194 element = self.marionette.find_element(*self._call_barring_locator)195 Wait(self.marionette).until(expected.element_displayed(element) and196 expected.element_enabled(element))197 element.tap()198 Wait(self.marionette).until(expected.element_displayed(*self._call_barring_page_locator))199 Wait(self.marionette).until(expected.element_displayed(*self._call_settings_query_locator))200 def wait_until_call_barring_info_received(self):201 Wait(self.marionette, timeout=120, interval=1).until(202 expected.element_present(*self._call_barring_status_disabled_locator))203 def tap_call_barring_all(self):204 element = self.marionette.find_element(*self._call_barring_all_switch_locator)205 Wait(self.marionette).until(expected.element_displayed(element) and206 expected.element_enabled(element))207 element.tap()208 Wait(self.marionette).until(expected.element_displayed(209 *self._call_barring_all_cancel_button_locator))210 self.marionette.switch_to_frame()211 Wait(self.marionette).until(lambda m: self.keyboard.is_keyboard_displayed)212 self.apps.switch_to_displayed_app()213 def tap_call_barring_all_cancel(self):214 element = self.marionette.find_element(*self._call_barring_all_cancel_button_locator)215 Wait(self.marionette).until(expected.element_displayed(element) and216 expected.element_enabled(element))217 element.tap()218 Wait(self.marionette).until(expected.element_displayed(*self._call_barring_page_locator))219 def tap_change_passcode(self):220 element = self.marionette.find_element(*self._change_passcode_locator)221 Wait(self.marionette).until(expected.element_displayed(element) and222 expected.element_enabled(element))223 element.tap()224 Wait(self.marionette).until(expected.element_displayed(*self._passcode_page_locator))225 self.marionette.switch_to_frame()226 Wait(self.marionette).until(lambda m: self.keyboard.is_keyboard_displayed)...
sim_settings.py
Source:sim_settings.py
...44 return self.marionette.find_element(*self._apn_editor_page_locator)45 def tap_network_operator(self):46 element = self.marionette.find_element(*self._network_op_locator)47 Wait(self.marionette).until(expected.element_displayed(element) and48 expected.element_enabled(element))49 element.tap()50 Wait(self.marionette).until(expected.element_displayed(*self._network_type_selector_locator))51 def tap_network_type(self):52 element = self.marionette.find_element(*self._network_type_selector_locator)53 Wait(self.marionette).until(expected.element_displayed(element) and54 expected.element_enabled(element))55 element.tap()56 self.marionette.switch_to_frame()57 Wait(self.marionette).until(expected.element_displayed(*self._network_type_confirm_button_locator))58 def confirm_network_type(self):59 element = self.marionette.find_element(*self._network_type_confirm_button_locator)60 Wait(self.marionette).until(expected.element_displayed(element) and61 expected.element_enabled(element))62 element.tap()63 self.apps.switch_to_displayed_app()64 Wait(self.marionette).until(expected.element_displayed(*self._network_type_selector_locator))65 def tap_apn_settings(self):66 element = self.marionette.find_element(*self._apn_settings_locator)67 Wait(self.marionette).until(expected.element_displayed(element) and68 expected.element_enabled(element))69 element.tap()70 Wait(self.marionette).until(expected.element_displayed(*self._reset_apn_btn_locator))71 def tap_data_settings(self):72 element = self.marionette.find_element(*self._data_settings_locator)73 Wait(self.marionette).until(expected.element_displayed(element) and74 expected.element_enabled(element))75 element.tap()76 Wait(self.marionette).until(expected.element_displayed(*self._add_new_apn_btn_locator))77 # also necessary to check for selections, since sometimes the button gets displayed first78 Wait(self.marionette).until(expected.element_displayed(*self._apn_item_locator))79 def tap_add_new_apn(self):80 element = self.marionette.find_element(*self._add_new_apn_btn_locator)81 Wait(self.marionette).until(expected.element_displayed(element) and82 expected.element_enabled(element))83 element.tap()84 Wait(self.marionette).until(expected.element_displayed(*self._apn_editor_page_locator))85 def select_authentication(self):86 element = self.marionette.find_element(*self._authentication_selector_locator)87 Wait(self.marionette).until(expected.element_displayed(element) and88 expected.element_enabled(element))89 element.tap()90 self.marionette.switch_to_frame()91 Wait(self.marionette).until(expected.element_displayed(92 *self._apn_selector_confirm_button_locator))93 def select_protocol(self):94 element = self.marionette.find_element(*self._protocol_selector_locator)95 Wait(self.marionette).until(expected.element_displayed(element) and96 expected.element_enabled(element))97 element.tap()98 self.marionette.switch_to_frame()99 Wait(self.marionette).until(expected.element_displayed(100 *self._apn_selector_confirm_button_locator))101 def select_roaming_protocol(self):102 element = self.marionette.find_element(*self._roaming_protocol_locator)103 Wait(self.marionette).until(expected.element_displayed(element) and104 expected.element_enabled(element))105 element.tap()106 self.marionette.switch_to_frame()107 Wait(self.marionette).until(expected.element_displayed(108 *self._apn_selector_confirm_button_locator))109 def confirm_apn_selection(self):110 element = self.marionette.find_element(*self._apn_selector_confirm_button_locator)111 Wait(self.marionette).until(expected.element_displayed(element) and112 expected.element_enabled(element))113 element.tap()114 self.apps.switch_to_displayed_app()115 Wait(self.marionette).until(expected.element_displayed(*self._apn_editor_page_locator))116 def tap_reset_to_default(self):117 element = self.marionette.find_element(*self._reset_apn_btn_locator)118 Wait(self.marionette).until(expected.element_displayed(element) and119 expected.element_enabled(element))120 element.tap()121 Wait(self.marionette).until(expected.element_displayed(*self._cancel_btn_locator))122 def tap_cancel_reset(self):123 dialog_view = self.marionette.find_element(*self._reset_apn_page_locator)124 element = self.marionette.find_element(*self._cancel_btn_locator)125 Wait(self.marionette).until(expected.element_displayed(element) and126 expected.element_enabled(element))127 element.tap()128 Wait(self.marionette).until(lambda m: 'current' not in dialog_view.get_attribute('class'))...
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!!