Contributions
Re: Transfer the value of one property to another without using groovy
Hello, I have had a simular problem. My solution was to use groovy to get the variable to a local variable and then you could create a new testproperty on testsuite level. You could also look at this message for local use of the variable: https://community.smartbear.com/t5/SoapUI-Open-Source/Groovy-Read-Response-using-xpath-in-a-soapui-property/m-p/176167#M28051 TestTestTest1.6KViews0likes0CommentsRe: Groovy: Read Response using xpath in a soapui property
Hi, Thanks to another tester we found the solution. I was missing a step. I was not able to use the ${TestCase#property} due to error messages in the groovy script. But is was not aware that you have to declare al local variable first if you want to use the property in the groovy script. So my solution was: step 1: fill the csv file ----csv file contents //person/sex step 2: put csv into array FIle filereader..etc.. testcase.setproperty("xpath_from_csv", propdata[0]) step 3: declare the property as a local variable in groovy xpath = context.expand ( '${#TestCase#xpath_from_csv} ') step 4: get the value from the response testcase.setproperty("sex_from_response", response[$xpath] ) //xpath comes from csv fil thank for all the help.2.8KViews0likes0CommentsRe: Groovy: Read Response using xpath in a soapui property
Hi, <quote>response["//person/sex"]</quote> is the xpath to extract te value from the response for the soap call. I want to put the text //person/sex in a csv file so i can create a generic building block so i can use this function wherever i want. what i know: - //person/sex retrieves the value i want (groovyutils) what i dont't know - how to replace the text //person/sex with an input(xpath) from the csv file. in short step 1: fill the csv file ----csv file contents //person/sex step 2: put csv into array FIle filereader..etc.. testcase.setproperty("xpath_from_csv", propdata[0]) step3: get the value from the response testcase.setproperty("sex_from_response", response[$xpath] ) //xpath comes from csv file Could you help me to replace the response xpath value so i can put this value into a csv file? thx2.8KViews0likes2CommentsGroovy: Read Response using xpath in a soapui property
Hi, I'm trying to replace the xpath with a soapui parameter that eventually will come from a csv, but errors keep showing up. This is the code. testRunner.testCase.setPropertyValue( "var_xpath_old", "//person/sex/") // will be in a csv //Response is here testRunner.testCase.setPropertyValue( "var_old", response["//person/sex") //<-- this is where is want to inject var_xpath_old any ideas?Solved2.9KViews0likes4Comments