Andrew_H
14 years agoOccasional Contributor
Using Directory Data Source w/ XPath
I am building a load test. I have a directory of about 1000 XML files (these are from a produciton environment). These XML have a few strings, and 1 -2 base64 encoded blobs of data inside a <Doc> tag (one <Doc> tag per document). What I want to do is have a test case set up that will genrate my new XML. The strings will all come from a Excel data source, I have that covered. What I am not sure of is how I can use the 1,000 XMLs in my directory as the source for the base64 encoded documents.
My requirements would be:
- the test case randomly selects the XML that its going to get the base64 from. It could also be a step through.
- if in the selected XML, there is only 1 <Doc> tag, only put one in the new XML being generated, if theres 2, put 2 in
The main idea here is to use production documents that are value but scramble the rest of the attributes in the XML, and reuse the 1000 valid documents over and over randomly through out the load test.
I dont know how to make the random or step through of the directory documents, or use XPath to get the values from them. Maybe there is a better approach. The XML file I am trying to generate, and the XML files in the directory are the same structure, so maybe a data masking approach is more appropriate.
Thanks in advance for your help!
My requirements would be:
- the test case randomly selects the XML that its going to get the base64 from. It could also be a step through.
- if in the selected XML, there is only 1 <Doc> tag, only put one in the new XML being generated, if theres 2, put 2 in
The main idea here is to use production documents that are value but scramble the rest of the attributes in the XML, and reuse the 1000 valid documents over and over randomly through out the load test.
I dont know how to make the random or step through of the directory documents, or use XPath to get the values from them. Maybe there is a better approach. The XML file I am trying to generate, and the XML files in the directory are the same structure, so maybe a data masking approach is more appropriate.
Thanks in advance for your help!