Forum Discussion
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
- joseph_michaud10 years ago
Staff
OK. I assumed wrong. The RunRoutine() method is coming from the Cucumber tool for TestComplete BDD: Cucumber + TestComplete. Beyond my ken.
The "Dispatch not hooked to windows memory" error is coming from the Java COM Bridge (JACOB) library used by Cucumber to access the TestComplete COM object and seems to indicate that the COM object (or rather the Dispatch object) is null. If I had this to play around with, I'd look at what is returned from
TestCompleteWorld.TC().GetIntegration()and look to see if there is anything relating to a Dispatch object.This is an issue best handled in a support case.