Cant replace autocomplete text

2025-02-25-11-22-49.flv (1.5 MB)


I wanna change the text to “sin” but somehow the previous text isnt deleted. Anyone can help me?

1 Like

can you move to the script mode and try to change there , if this is your question


@Monty_Bagati here bro

So replace the text sin in line 32 , is that what u want to do?

Meybe this helps…

Try using WebUI.cleartext keyword before SetText() .

And another helpful hint could be when you move from one page to another, you can add: WebUI.waitForPageLoad(10). An example would be:

WebUI.navigateToUrl('dev.trutrip.co')
WebUI.waitForPageLoad(10)

You can also add the above statement when you move from your Login page to your TruTrip page.

And, I notice you are clicking on a <p> tag. Instead, you can verify it is there, like:

WebUI.waitForPageLoad(10)

WebUI.verifyElementClickable(findTestObject('Page_TruTrip/Page_TruTrip/p_Singapore Changi'))
or
WebUI.verifyElementVisible(findTestObject('Page_TruTrip/Page_TruTrip/p_Singapore Changi'))

its didnt work bro, text is showing again after it

yes, delete previous text and replace it with sin

still didnt solve the issue, i tried it and nothing change

Hmmm, Maybe there is some event asociated with that element.
So, I would recommend to use the power of Javascript :upside_down_face:.

Based on the WebUI.executeJavascript keyword .

You can send a javascript script to the driver. and change the text of a identified element.

maybe something like this helps: document.getElementById("the_ID_of_Autocomplete_element").value = "Sin"

So, you can use the keyword like this:

WebUI.executeJavaScript(“document.getElementById(‘the_ID_of_Autocomplete_element’).value = ‘Sin’”, null)

thanks guys for the answer , its solved with this script
{8AA87108-3E44-4221-9DEF-16F5DA42D1A2}

1 Like