(self, v, text)
| 4210 | warnings.warn("pressKeyCode only implemented using UiAutomatorHelper. Use AdbClient.type() instead") |
| 4211 | |
| 4212 | def setText(self, v, text): |
| 4213 | if DEBUG: |
| 4214 | print("setText(%s, '%s')" % (v.__tinyStr__(), text), file=sys.stderr) |
| 4215 | if self.uiAutomatorHelper: |
| 4216 | if DEBUG_UI_AUTOMATOR_HELPER: |
| 4217 | print("Setting text through UiAutomatorHelper for View with ID=%s" % v.getId(), file=sys.stderr) |
| 4218 | selector = v.obtain_selector() |
| 4219 | obj_ref = self.uiAutomatorHelper.until.find_object(body=selector) |
| 4220 | response = self.uiAutomatorHelper.ui_device.wait(obj_ref.oid) |
| 4221 | self.uiAutomatorHelper.ui_object2.set_text(response['oid'], text) |
| 4222 | else: |
| 4223 | # This is deleting the existing text, which should be asked in the dialog, but I would have to implement |
| 4224 | # the dialog myself |
| 4225 | v.setText(text) |
| 4226 | # This is not deleting the text, so appending if there's something |
| 4227 | # v.type(text) |
| 4228 | |
| 4229 | @staticmethod |
| 4230 | def sayText(text, voice=None, verbose=False): |
nothing calls this directly
no test coverage detected