I’m using the following key sequence,
protected void assertFieldValues(String fieldId, String value) {
focus("id=" + fieldId);
type("id=" + fieldId, value);
keyDown("id=" + fieldId, value);
keyUp("id=" + fieldId, value);
}
When I call the method for the first time it works without an issue,
public String REQUISITION_TOTAL = "requisitionTotal";
//initially add total
assertFieldValues2(REQUISITION_TOTAL, "1500");
When I call it a second time to overwrite the original value,
//Overwrite total, but fails.
assertFieldValues2(REQUISITION_TOTAL, "2500");
I get the following error, invalid key sequence. It seems to be failing on keydown, if I remove keydown it fails on keyup.
Any ideas what I’m doing wrong? I need the keyup to run js calculations.
It depends on which key you want to press down and release up.Say for example if you want to press “Enter key” the code will look like this :
Where 13 is the key value for Enter Key.
For mode key codes refer this link Key Codes and ASCII Values