18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
Need help in using _rteWrite using Java API
Hi,
I am automating my web page using sahi. There are a few places where i have added rich text editors in iframes.
I can easily set values to the rich text editor when i use the sahi script.
_rteWrite(_rte(0,_in(_div("contents[1]"))), "Hi there");
But i want to use this same functionality using the Java API.
i found browser.rte() API . but i could not find anything similar to rteWrite().
i even tried browser.rite(0,browser.in(browser.div("contents[1]"))).rteWrite("Hi There!");
but doesn't seem to work.
Help in this matter would be highly appreciated.
I am automating my web page using sahi. There are a few places where i have added rich text editors in iframes.
I can easily set values to the rich text editor when i use the sahi script.
_rteWrite(_rte(0,_in(_div("contents[1]"))), "Hi there");
But i want to use this same functionality using the Java API.
i found browser.rte() API . but i could not find anything similar to rteWrite().
i even tried browser.rite(0,browser.in(browser.div("contents[1]"))).rteWrite("Hi There!");
but doesn't seem to work.
Help in this matter would be highly appreciated.
This discussion has been closed.
Comments
Some APIs from the javascript version have been missed out in the Java version. We are fixing that. Mean while, try this
BrowserElement el = browser.rte(0, browser.in(browser.div("contents[1]")))
browser.execute("_sahi._rteWrite(" + el + ", 'Hi There!')");
Regards,
Narayan
I will work on it and let you know the results.
This seems to be working fine. But when i run this code in a loop with variables, it fails. The script times out.
Code Used:
for(some looping code)
{
// invoke a dialog
BrowserElement el = browser.rte(0, browser.in(browser.div("contents[1]")))
browser.execute("_sahi._rteWrite(" + el + ", '"+variableName+"')");
// close dialog
// then do something else.
// come back to the same page
}
To debug scripts like these, give a hardcoded value to variableName in the loop and check if the loop works correctly. Once you are sure your looping logic is correct, replace with variableName and check.
Btw, we can get you a new build with rte methods implemented, if you can wait till Friday.
Regards,
Narayan
Thanks,
Ajay
Did the build get released on friday ? I couldnt find any information regarding it on the website.
Regards,
Ajay
Regards,
Narayan
Regards,
Ajay
I somehow made it work. I think it works better now. Even inside the loop.
Still waiting for the build though.
Thanks narayan. This workaround is of great help.
Regards,
Ajay
We have emailed you a link to the build.
Regards,
Narayan
Thanks for the build.
Works great.
Thanks again,
Ajay