Hello,
Please help me with the below iddue.
- I set the username field and password field to some text say
Username: 1test1@test.com
Password: test - Now I clear the field using the below code
@Keyword
def static clearElementText(TestObject to) {
WebElement element = WebUiCommonHelper.findWebElement(to,30)
WebUI.executeJavaScript(“arguments[0].value=’’”, Arrays.asList(element))
}
and then
TestObject to = findTestObject(‘Login/input_Email’)
CustomKeywords.‘react.methods.clearElementText’(to)
- Now I have cleared the field with the above code(which works). But when I try to set the same Username field with some other text- say
WebUI.setText(findTestObject(‘Login/input_Password’), “test”)
The Username field fills like below
1test1@test.comtest
- Or if i try to fill it in with no text using
WebUI.setText(findTestObject(‘Login/input_Password’), " ")
It sets itself to the initial Username field which is
Basically, by default it fill the field by the very first input. Please let me know if anyone has any solution for this.
I can provide with more details and screenshots if required.