I can’t check the checkbox unless I scroll the contents of the text field to the end, but I don’t know how to scroll inside the text field. Could someone please give me some advice?
Thank you.
kindly share the html or logs or error trace to help out
You can try to use the “scrollToElement()” options as @atul.rai suggests and you may even try WebUI.scrollToPosition(100, 99999)
to see if that works too.
What I was thinking though is to create a StringBuilder that contains lots (AND LOTS) of line feeds that you set in the text field and see if that does anything.
StringBuilder strB = new StringBuilder()
for (int cnt = 0; cnt < 100; cnt++) {
strB = strB.append("\n")
}
strB.append("MagicText")
WebUI.sendKeys(findTestObject(...), strB.toString())
Another idea would be to try WebUI.clickOffset(findTestObject(...), XPos, YPos)
but this one would need a fair bit of study of your element’s size, etc. and some math.
Edit: There was an OP in this forum that used scrollToElement to scroll in a drop-down list to find a specific reference in the list. You might be able to use the StringBuilder to create a chain with a specific text at or near the end and then scrollToElement to that text. You would need to create a parameterized Object in either code or the OR and replace your parameter with the text you want to scroll to, such as “MagicText”.
WebUI.scrollToElement(findTestObject('...', [('my text'): "MagicText"]), 2)
Edit2: I made the assumption that your text field was empty. If it is not, then perhaps just search for a text string. or phrase, that is near the last of the characters within the text field and go with the concept of the scrollToElement.