Script says the java class function as "Not a function". Pleas help how to fix this.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Script says the java class function as "Not a function". Pleas help how to fix this.
Hi,
JavaClasses.mongoDB.MongoDBInitialize.getShippedOrderCounts();
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Javaclasse.Packages.class.__.
One thing to mention .. documentation says in syntax to use subclass after the class. Is that mandatory?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
