Forum Discussion
- kavansays10 years agoContributor
Thanks EVarnavsky, we already tried this link but no luck.. Below is the actual code we tried, if you could find the solution..
->> Actual Code
@When("^Amend trade for commission from UI$")
public void amend_trade_from_UI() throws Throwable {
TestCompleteWorld.TC().RunRoutine("Amend_Commission.Fn_AmendCommission", processedOmsId);
log.info("Amend Trade(Comment) through GUI automation Successful---->"
);
}
We tried Below code:
-----------------------------------------------------------------------------------------
'->> Throws null pointer exception because vtc remains null after execution.@When("^Amend trade for commission from UI$")
public void amend_trade_from_UI() throws Throwable {
Variant vtc = null;
try {
vtc = TestCompleteWorld.TC().RunRoutine("Amend_Commission.Fn_AmendCommission", processedOmsId);
} catch (Exception e) {
// TODO Auto-generated catch block
ActiveXComponent act = new ActiveXComponent(vtc.toDispatch());
}
log.info("Amend Trade(Comment) through GUI automation Successful---->");
}
-----------------------------------------------------------------------------------------Cheers,
Kavan Shah
- joseph_michaud10 years ago
Staff
I'm assuming that the use of "RunRoutine()" is from the TestComplete COM interface. If so, it doesn't look like you're providing the correct arguments (I think...). See docs for RunRoutine Method and an example shown in Calling Script Routines via COM
- kavansays10 years agoContributor
Hi,
I am able to call Run Routine and execute the scenario but in "Dispatch Hook Error" occurs occasionally, so i still think issue is regarding some object release, as we are creating the TestComplete object we also need to close that object but i am not sure how to implement this.
Thanks..
Kavan Shah