Forum Discussion

smartbearrj's avatar
smartbearrj
Contributor
5 years ago

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.

 

8 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    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?

    • smartbearrj's avatar
      smartbearrj
      Contributor
      There is nothing after the class is shown when used
      Javaclasse.Packages.class.__.
      One thing to mention .. documentation says in syntax to use subclass after the class. Is that mandatory?
      • smartbearrj's avatar
        smartbearrj
        Contributor

        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.