mongoDB is a package ,
MongoDBInitialize is a class and
getShippedOrderCounts(); is a static method in the class.
But on execution it says, getShippedOrderCounts() is not a function.
I have sett java, java -bridge, jar and class included in place.
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?
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.
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.
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.
I have written the class by myself which basically has two static methods in it. So I followed the documentation in the smartbear portal, I followed everything there, there was nothing specific about exposing the methids in the class.
The documentation available from TestComplete simply talks about how to consume JAR classes/files. If you need specific help in creating your own unique JAR, you might need to contact SmartBear support directly.