Forum Discussion
That may be a function in the class, but it might not be exposed as such in TestComplete. You SHOULD be able to get code completion/intellisense in TestComplete once you try the code in place. What does it show up as in TC?
Javaclasse.Packages.class.__.
One thing to mention .. documentation says in syntax to use subclass after the class. Is that mandatory?
- smartbearrj5 years agoContributor
I am not able to get the static methods of the Java class in code completion.
Also if I type the methd name after the class name , on runtime its says the function name as not-a function.
e.g. I tried mongodb. MongoDBInitialize.getShippedOrders().......... then it says getShippedOrders() as not a function.
I am able to get package mongodb and MongoDBInitialize class after JavaClasses but not the getShippedOrders() method after that.
Please advise.
- smartbearrj5 years agoContributor
Is there anyone who can help.
I tried a fresh TestComplete project and configured java bridge at tool level and also listed the jav classes and the java class path in the form of a jar file.
Still I am getting the same issue.
Errro in the log-
"ErrorTypeError: JavaClasses.mongoDB.MongoDBInitialize.getShippedOrderCounts is not a function
at connectToMongoDB (<aq:Unit1>:7:64) 12:45:28 Normal 0.00"I can't see my static methid listed in the code completion so as a result it says the method in the class as not-a function on runtime.
- tristaanogre5 years agoEsteemed Contributor
So... this Java class... is this one you wrote yourself? something you got somewhere else? Because "getShippedOrderCounts" seems to be AWFULLY specific for a generic MongoDB JAR library. You might need to do some work within your JAR to expose the method.