appium-uiautomator2-server icon indicating copy to clipboard operation
appium-uiautomator2-server copied to clipboard

Unable to send text to edit text element by accessibility ID from Jetpack compose

Open stowy opened this issue 2 years ago • 1 comments

I set the accessibility of a text field as follows:

                    OutlineTextField(
                        value = email,
                        onValueChange = viewModel::onEmailChange,
                        keyboardOptions = KeyboardOptions(
                            keyboardType = KeyboardType.Email,
                            imeAction = ImeAction.Next
                        ),
                        modifier = Modifier
                            .fillMaxWidth()
                            .focusRequester(focusRequester)
                            .semantics(mergeDescendants = true) {
                                testTag = "email";
                                testTagsAsResourceId = true},
                    )

It says the element cannot have the value set, eg see attached screenshot

Screenshot 2023-12-04 at 4 55 04 pm

If you click on the edit text above and send it passes the text

I'm using the robot library to send the input text which find field by accessibility Id.

stowy avatar Dec 04 '23 07:12 stowy

I wondered if the "EditText" should have been selected. Or alternatively, https://github.com/appium/appium-uiautomator2-driver?tab=readme-ov-file#mobile-type may work after clicking the element

KazuCocoa avatar Dec 04 '23 07:12 KazuCocoa