Failed to set text into element

I am trying to set input text to this selector. Its giving me error.

The line of code looks like this: Mobile.setText(findTestObject(‘Object Repository/Android Sanity/QuikPay/expiryDate’), ‘December-2025’, GlobalVariable.TIMEOUT_SHORT)

Screen Shot 2018-05-10 at 4.36.39 PM.png

Are you sure it is possible to input text manually? It doesn’t seem like a text input to me, more like a scroll up-down thingy. Of course, it is hard to tell without the app code.

Yes it is a input text field. This is the object. Please see the expiry date field.

Screen Shot 2018-05-11 at 12.37.07 PM.png

@Mate Mrse see if this is helpful

What is the error message you receive?

@Vinh Nguyen This is the error message:

Failed to set text into element (Root cause: org.openqa.selenium.StaleElementReferenceException:

Screen Shot 2018-05-11 at 3.27.27 PM.png

I rectified the issue. After calling tap method i am setting text of month and year now. My issue has been resolved. Thanks guys for your inputs.


You are missing timeout parameter for set text keyword. Please visit this document for more details:

Mobile.setText(findTestObject('Application/Graphics/android.widget.TextView - Xfermodes'),'Your text here', 10)
1 Like