Forum Discussion

johan_l's avatar
johan_l
New Contributor
10 years ago

Problem with hexadecimals in JDBC Request

Hi! I am using SoapUi Pro 5.1.2. I got this problem with hexadecimals when I try to fetch it from the database.

 

For example, I make a JDBC request where I just try to get the id from the table. So I get the id <FOO_ID>CE900E5B0A142D913A1E3A1E2D259DB0</FOO_ID>, the problem is that because its a hexadecimal the id in the table is 0xCE900E5B0A142D913A1E3A1E2D259DB0. So when I do a property transfer and try to fetch a another table with that id I wont find it because of the missing 0x. 

 

What is the best way to tackle this issue?

 

Thank you for your help!

  • May be you can introduce a groovy script as intermediate step or add a script assertion step and do the following:
    Get the required value, concatenet it with missing string and set it as a test case property, then use it in the next step.
  • Wrote this little script

     

    def fooVariable= testRunner.testCase.testSuite.getPropertyValue("fooVariable")
    if(!fooVariable.substring(0,2).equals("0x")){
    testRunner.testCase.testSuite.setPropertyValue("fooVariable","0x"+fooVariable)
    }

    seems to work

     

  • nmrao's avatar
    nmrao
    Champion Level 3
    May be you can introduce a groovy script as intermediate step or add a script assertion step and do the following:
    Get the required value, concatenet it with missing string and set it as a test case property, then use it in the next step.
    • johan_l's avatar
      johan_l
      New Contributor

      Wrote this little script

       

      def fooVariable= testRunner.testCase.testSuite.getPropertyValue("fooVariable")
      if(!fooVariable.substring(0,2).equals("0x")){
      testRunner.testCase.testSuite.setPropertyValue("fooVariable","0x"+fooVariable)
      }

      seems to work