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.
Keypress in Java??
Hi All,
How do i tell sahi to press "Enter key" in Java ??
Thanks and regards,
Akshada
How do i tell sahi to press "Enter key" in Java ??
Thanks and regards,
Akshada
Comments
But its not working!!
I tried using a "Textbox". That doesnot work!!
Is there any other way in JAVA to do this??
Thank you very much for the help!!
Regards,
Akshada
Is there any other way for "Enter Key" Keypress in JAVA??
Thanks in advance!!
Regards
Akshada
Can you specify how you tried with a textbox? If you say something does not work, please do post what you tried so that we can verify and reproduce it here.
Regards,
Narayan
I did I tried this : browser.execute("_sahi._keyPress(_sahi._textbox('SearchInput'), [13,13]);");
I'll take care of this next time!!
Thank you!
Regards,
Akshada
We checked this and looks like pressing enter using keypress 13 does not work if the element does not have an explicit keypress handler.
You can try this instead:
browser.execute("_sahi._textbox('SearchInput').form.submit()");
This is a workaround, till we figure out a better solution.
Regards,
Narayan
There was this functionality which allowed User to use "Tab" and "Enter" keys which i wanted to automate.
Otherwise i am able to record and playback the same. Issue was with "Enter key" and "Tab Key"
Thank you for the help!! :-)
Regards
Akshada
Theres a "search" functionality avalaible in my application, So its like A text-box where u enter your keyword and a search image . On entering keyword and clicking on the Searck image, i should get valid results.
Also if User entersKeyword and presses "Enter-Key" (No clicking on "Search image"), Valid results should be displayed. Which is what i want to test using Java!!
Thanks and regards
Akshada
i'm testing a system in php that a user cannot input letters or special characters, it can only accept numbers...
onkeypress='javascript: return isNumberKey(event);'
but using sahi, automation, the system can accept the other characters...
WHAT SHOULD I DO?
help me pls...
tnx...
As you mentioned, pressing enter using keypress 13 does not work if the element does not have an explicit keypress handler. You suggested browser.execute("_sahi._textbox('SearchInput').form.submit()");
How can I achieve the same thing using sahi script? Is there anyway to submit the form?
Looking forward for a quick reply, since I have a demo scheduled tomorrow morning
Thanks a ton in advance.
Regards,
PRasad