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);
Since Key events happens at OS level, Please make sure that your app under test is active while re-playing the test.
Last updated: March 09, 2023
If you have any feedback on this topic, please contact us at documentation@appvance.ai