IBM Rational Functional Tester (RFT) - Descriptive Programming : Code to perform a key press action on already selected object on application.
public boolean key_Press_withoutobject(String KeyName){
try{
boolean result = true;
getScreen().getActiveWindow().inputKeys(KeyName);
setLogMsg("Pressed Key: "+KeyName,true);
return result;
}
catch(ObjectNotFoundException e){
logTestResult("Object not found :" +e.getMessage()+" in keyword key_Press_withoutobject",false,"");
return false;
}
catch(NullPointerException e){
logTestResult("Null error :" +e.getMessage()+" in keyword key_Press_withoutobject",false,"");
return false;
}
catch(Exception e) {
logTestResult("Exception :" +e.getMessage()+" in keyword key_Press_withoutobject",false,"");
e.printStackTrace();
return false;
}
}
No comments:
Post a Comment