Service Virtualization

Expand all | Collapse all

Can't assign java.lang.Integer to java.lang.String

Jump to Best Answer
  • 1.  Can't assign java.lang.Integer to java.lang.String

    Posted 07-08-2016 08:46 AM

    Hi , I am using a javaScript step in LISA 7.5, to fetch property value of "schemaNumber" from project.config. When running this step (itr\staging) , I am getting the below error with line number as "-1". Not sure exactly what is happening

     

    Variable assignment: schemaNumber: Can't assign java.lang.Integer to java.lang.String : at Line: -1 : in file: <Called from Java Code> : <Compiled Java Code>

     

    When I tried with a renamed propertry (like db.schemaNumber) this error is not happening. I am clueless about what is the isse here?

     

    I need to use the property value as "schemaNumber", to ensure i meet all the dependencies to execute the test case.

     

    Any help is much appreciated. Thanks



  • 2.  Re: Can't assign java.lang.Integer to java.lang.String
    Best Answer

    Broadcom Employee
    Posted 07-08-2016 09:29 AM

    Hello Utham,

     

               I tried adding a property with same name in project.config and tried retrieving it javascript step. It worked fine. I even tried assigning the property to a String variable and it seems to work fine (Image enclosed). Please let us know on the script you are using.

     

    Thanks,

    Surya.

     

    Property.png



  • 3.  Re: Can't assign java.lang.Integer to java.lang.String

    Posted 07-12-2016 11:47 AM

    Hi UthamKumar,

     

    Did either of these responses help to answer your question? If so - please mark the most helpful response as correct. If not - it would be great if you could provide some additional information so our experts can better understand what type of info you're looking for.

     

    Thanks!

    Melanie



  • 4.  Re: Can't assign java.lang.Integer to java.lang.String

    Broadcom Employee
    Posted 07-25-2016 09:27 PM

    Hi Utham,

      Can you please tell us how you are trying to retrieving property from project.config file in javaScript step

    Thanks

    Srikanth.



  • 5.  Re: Can't assign java.lang.Integer to java.lang.String

    Broadcom Employee
    Posted 07-08-2016 08:51 AM

    If possible please provide the complete code you have used in javascript or the lines of code where you assign/use the value associated with "schemaNumber"