Skip to main content

EnterKey Event in Sahi.

6202 ,51 rebotcO :detadpu tsaLBelowBelow 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);


SinceBecause Keykey events happensare sent at OSthe operating-system level, Pleasekeep makethe sure that your appapplication under test is active while re-playingreplaying the test.scenario.


Last updated: MarchOctober 09,15, 20232026

If you have any feedback on this topic, please contact us at documentation@appvance.ai.