windend
13 years agoOccasional Contributor
How to call a function of other script unit by method name as parameter in VB?
hello, I'm studying TestComplete to perpare for a new project. We are plan to build a framework on TestComplete for regression testing of web application. Is there some solution in VB in TestComplete as below Java code? We want to invoke functions in other script unit by function name as parameter. I have seen
//Java Code Begin
Runner.CallObjectMethodAsync
method, but i'm not sure if it's suitable for our request. Thank you for your great help!//Java Code Begin
Class cl = Class.forName("com.Common.KeywordHelper");
Class
partTypes[] = new Class[] { String.class, Integer.class,TestObject.class, String.class, String.class,String.class };
Object params[] = new Object[4];
Method mthd = cl.getMethod(methodName,partTypes);
result = (Boolean) mthd.invoke(new KeywordHelper(),(Object[]) params);
//Java Code end