Comments

I'm afraid I don't clearly understand what you are trying to do. Perhaps attaching your tst file would be more helpful for me to understand your setup. I also have some questions to try and clarify my understanding. When you say the value is stored as a "DataTable Parameter", do you mean it is inside of a Table Datasource? Also, how are you doing the assertions for the element? Do you somehow extract the three values individually in order to do your assertions of the individual values? How did you setup the assertion values ("VALUE1", "VALUE2", "VALUE3")?

Again, perhaps attaching your tst file along with answers to these questions will give me a better idea on how to approach your testing needs.

I'll try to clarify:I'm obtaining the first value from an xml response. Specifically, I'm retrieving the data from one element, which data is exactly: "VALUE1 VALUE2 VALUE3" It means that this is a white space separated set of three values.

Then, from another call, I'm trying to assert that a certain element being returned, is either "VALUE1" or "VALUE2" or "VALUE3".In order to do this, I was thinking in use the "Regular Expression" Assertion.

So my main question is how to transform the first obtained value -->"VALUE1 VALUE2 VALUE3" into something like "VALUE1|VALUE2|VALUE3", which is the format of regular expressions assertion to indicate that any of those values is expected.

Thanks for the detailed description. I believe I understand what you are trying to do now.

So for instance you first receive a response that looks like this: (with other elements also in the response)<xml>...<values>test tester testers</values>...</xml>

Then you make a new query wherein a separate response looks like this:

<xml>...<singlevalue>testers</singlevalue>...</xml>

And now what you want to do is check to make sure that the "<singlevalue>" element contains one of the strings from the "<values>" element.

You have the right idea in using a regular expression assertion however I think there is something a little easier that you can do to create the regular expression rather than just transforming the values of the response.

What I recommend is that you store the regular expression inside of a Test Suite Variable and then parameterize the regular expression against this test suite variable. I have attached a very simple tst file that shows you can achieve this. (i created the file in SOAtest 6.2 service pack 5 so you may need to update to that service pack in order to open the tst file: SOAtest > Check for Updates (assuming you already have SOAtest 6.2)).

Here's a description of what i did in the tst file and you can easily move this over to your own implementation:

1) I attached a Response SOAP Envelope --> XML Data Bank as an output to the test that receives the response containing the element with three values. -- Inside the Data Bank, I extract the value for the element and give it a data source column name (i.e. values).

3) Next I added an Extension Tool Test, right after the Test that receives the response with three values in the element (it doesnt have to be immediately after, just sometime after this test). -- In the extension tool I wrote the following code:

4) Then in the test wherein I receive a response that contains a single value, I add an XML Assertor as ouput. In the configuration for a regular expression, I changed it to "parameterized" and selected the name of the test suite variable I selected.

After saving all changes and running the test suite, you can see that the test passes since I receive a value that is one of the three values. You can change the value in the test to be anything else so you can see it fail as well.

If you have any questions, please feel free to let me know. Otherwise, adapting these steps to your own test should allow you to do regular expression assertions with those three values.

Thanks for the information. Sorry for assuming you had the latest SOAtest. As for that error message, I believe it is because that function isn't defined for 5.5.3 (we've made a lot of changes to the method tool (i.e. we now call it the extension tool fyi )).

Therefore, I've looked through the api for 5.5.3 (which I believe you can access through the help menu in SOAtest for more details) and I see some differences in functions available for use.

I always return True because the setValue function doesn't return something, so you may want to keep in mind that although the extension tool returns true, it doesn't necessarily means it successfully set the value. You'll have to check that yourself.

Dear Denard,After trying with no success to reproduce this in 5.5.3, I have some good news: Just installed Soatest 6.2 and will try to push forward to use this latest version as standard in the company, as it seems pretty stable and has a lot of very good features incorporated.

So the first solution you proposed worked perfectly using SoaTest 6.2.

If you want to create "VALUE1|VALUE2|VALUE3" from a text node with the content "VALUE1 VALUE2 VALUE3", you don't need to use scripting. Within the XML Data Bank, you can use an XPath that replaces each space with a "|". Create an extraction with this XPath: