EnterKey Event in Sahi.
Below is the sample code snippet to work with EnterKey.
var $storedVars = new Array();
_sahi.robot = new java.awt.Robot();
Sahi.prototype._typeNativeKeyCode = function(keyCode){
this.robot.keyPress(keyCode);
this.robot.keyRelease(keyCode);
};
_navigateTo("http://sahitest.com/demo/training/login.htm");
_setValue(_textbox("user"),"test");
_setValue(_password("password"),"secret");
_sahi._typeNativeKeyCode(java.awt.event.KeyEvent.VK_ENTER);
_wait(10000);
Because key events are sent at the operating-system level, keep the application under test active while replaying the scenario.
Last updated: October 15, 2026
If you have feedback on this topic, contact documentation@appvance.ai.