cancel
Showing results for 
Search instead for 
Did you mean: 

invoking java functions from testcomplete

Highlighted
Regular Contributor

invoking java functions from testcomplete

I am trying to invoke testing functions written  in java  from testcomplete following 

Calling Functions From Java Classes 

https://support.smartbear.com/testcomplete/docs/testing-with/advanced/using-external-functions/calli...

 

I have defined  my java bridge and specified my jars, but code complete is not completing anything for JavaClasses

Under "Install Extensions"  Java Application Support and Java Classes Support is enabled.

 

It seems as if TestComplete is not seeing the java runtime ?

 

I have the Process Filter set to "use only selected processes"  I tried adding java to the process list,  and also selecting "use all processes"  but this did not seem to make any difference in showing Java clasess under code complete.

 

I am using version 12 .10 of TestComplete.

 

 

 

 

14 REPLIES 14
Community Hero

Re: invoking java functions from testcomplete

You say you have defined your jars, have you specified the classes you are wanting to call in the Java Classes section above the Class Paths?


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
Community Hero

Re: invoking java functions from testcomplete

you have to add your classes as like below.

 

<package name as like your import of that class>.<class name>

 

java-bridge.PNG


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”


Extension Available

Regular Contributor

Re: invoking java functions from testcomplete

class_paths.PNG


@chickswrote:

I am trying to invoke testing functions written  in java  from testcomplete following 

Calling Functions From Java Classes 

https://support.smartbear.com/testcomplete/docs/testing-with/advanced/using-external-functions/calli...

 

I have defined  my java bridge and specified my jars, but code complete is not completing anything for JavaClasses

Under "Install Extensions"  Java Application Support and Java Classes Support is enabled.

 

It seems as if TestComplete is not seeing the java runtime ?

 

I have the Process Filter set to "use only selected processes"  I tried adding java to the process list,  and also selecting "use all processes"  but this did not seem to make any difference in showing Java clasess under code complete.

 

I am using version 12 .10 of TestComplete.

 

 

 

 


My classes were uploaded. 

Community Hero

Re: invoking java functions from testcomplete

I know why you are not getting.

 

class_paths.PNG


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”


Extension Available

Regular Contributor

Re: invoking java functions from testcomplete

I'm sorry Shankar,  I don't understand.

Community Hero

Re: invoking java functions from testcomplete

Hi,

 

You must specify exact .jar file(s), but not just path to them. Check previous screenshot from Shankar where this is clearly illustrated.

 

P.S. Well, the above text seems to be irrelevant as the help says that paths can be specified as well. The idea that I have at the moment: from the screenshot from your initial message, it looks like that you are referencing 64-bit Java runtime. What flavor of TestComplete you are using? 32-bit or 64-bit? This can be checked via the Help|About window. In case you are using 32-bit TestComplete, try to start 64-bit flavor from the <TestComplete>\x64\bin\ folder and check if it helps.
Alternatively, you may try to reference 32-bit Java runtime and use 32-bit TestComplete.

Not sure, but hope that this might help.
If it does not, a screenshot that illustrates the observed behavior and the description of your expectations might help.

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Regular Contributor

Re: invoking java functions from testcomplete

I'm using 64  bit test complete 12.10.

Changing to specify the 64  bit JRE does not seem to change the behavior.

Changing to specify the exact jars does not seem to change the behavior.

 

The desired behavior is that code complete gives me some dropdowns for the java classes.  However,  it remains empty.

When I try: 

 

function test_java_api() {

bob = JavaClasses.excentus.tests.excentus.rl.rise.integration.api.RiseAPI;

}

 

I get: 

 

'JavaClasses' is undefined Error location: Unit: "Shell_Member_Portal_suite\MemberPortal\Script\prototypes" Line: 4369 Column: 4.

'JavaClasses' is undefined
Error location:
Unit: "Shell_Member_Portal_suite\MemberPortal\Script\prototypes"
Line: 4369 Column: 4.
Regular Contributor

Re: invoking java functions from testcomplete

do the java classes need to be under the test complete folder ?

Community Hero

Re: invoking java functions from testcomplete

You have Java-bridge path as C:\Program Files(x86)\java\jre 1.8.0_9\bin\java.dll

 

Change your Java Bridge folder to JDK like below.

 

jb.PNG


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”


Extension Available

New Here?
Join us and watch the welcome video:
Top Kudoed Authors