I am attempting to retrieve the text of an input using the .text() method in Selenium. However, every time I try to locate the element, it says that the specified ID was not found.
(I am working with the Input component from NativeBase, but I have also tested it with the TextInput native component)
<Form>
<Item testID='input_nomePaciente_formPacientes' stackedLabel>
<Label style={styles.label}>Nome</Label>
<Input
value={this.state.paciente.nome.toUpperCase()}
style={styles.inputForm}
testID='input_testID'
autoCorrect={false}
keyboardType={(Platform.OS === 'android') ? 'visible-password' : ''}
autoCapitalize='none'
onChangeText={(text) => this._updateItem('nome', text, 0)} />
</Item>
While I can use sendKeys() and click() on the Item with the specified testID, I am unable to interact with anything inside the input field. Additionally, I cannot access the value within the field using the Item's testID.
This is how I am trying to retrieve the output:
let testID = await driver.elementByAccessibilityId("input_testID");
let testIDValue = await testID.text();
console.warn(testIDValue);