HomeSUPPORT QUESTIONS

Need help with StresStimulus? Start here.

Question about extractor Messages in this topic - RSS

Shasha Han
Shasha Han
Posts: 8


8/15/2013
Shasha Han
Shasha Han
Posts: 8
Hi, Team
I come here again for an answer for using extractor. The question is very simple. I'm wondering can it work when I use multiple test case? For example, I create a new entity in Test Case 1 and use extractor to get its ID after saving. Then I want to use that ID in Test Case2 and Test Case 3. Can I do that with current extractor version?
Thank you in advance.
Shasha
0 link
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583


8/16/2013
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583
Shasha,
Every extractor is attached to a specific test case / request, so it cannot be used in a different test case. However, you can clone an extractor in the script editor and slightly modify it . Here's an example: the following script tag represents extractor ID_extractor_TC1 that is attached to session "11" in the test case 1:

   <Extractor ExtractorType="TextDelimited" TextBefore=" ID =" TextAfter="&quot;" Name=" ID_extractor_TC1" Occurrence="1" IsHtmlDecode="No" IsUrlDecode="No" TestCase="<Test Case 1 GUID>" Session="8" />
 This tag was cloned; the extractor name was changed to ID_extractor_TC2 to keep it unique, the session was changed to "15" and the GUID of the test case 2 was used.
 
   <Extractor ExtractorType="TextDelimited" TextBefore=" ID =" TextAfter="&quot;" Name=" ID_extractor_TC2" Occurrence="1" IsHtmlDecode="No" IsUrlDecode="No" TestCase="<Test Case 2 GUID>" Session="15" />
 
Test case GUID can be found in the ID property of the Test Case tag
   <TestCase Id="5ee84589-2303-4779-becc-e37b37abaf9b" Name="Test Case 1" …>

Does this answer your question?

-Vadim
 
0 link
Shasha Han
Shasha Han
Posts: 8


8/16/2013
Shasha Han
Shasha Han
Posts: 8
Hi, Vadim
 
Thank you for you answer. I'm still having another question based on your answer.
 
If I clone the extractor for multiple test case, can they change by iteration? Due to the fact that my test case 2 and test case 3 are based on test case 1. So when the iteration1 start, these test cases will use same ID(ie ID1). I'm wondering, when the test case2 comes to the iteration2, can it use ID2 that created in test case 1 during the iteration2?
 
Thank you in advance.
0 link
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583


8/18/2013
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583
Shasha,

I'm not sure I fully understand your question, but let me make some clarifications. In the real world, physical users are independent and StresStimulus mimics such independent users.  In every test case one or several VUs emulating unique physical users are instantiated. So, if VU1 is instantiated in TC1, it cannot be also instantiated in TC2. Iterations are also independent and have private contexts not accessible from other iterations. So iteration2 in TC2 cannot access data created during iteration2 in TC1. If, for example, in TC1 server generated a unique security token for VU1 that you captured to an extractor, then this value should not be available to any VU in any iteration in TC2. Note that when you clone an extractor between test cases in design time, using script editor, you just copy the extractor definition, which not to be confused with extractor values that will be determined during the test run  in every iteration /   VU / TC independently.

With that said, you still can use the same parameter values across different iterations. Let's say in TC1 on Iteration2 your server returns value "ID2", stored in the "MyExtractor", and in TC2 on Iteration2 the server returns the same value "ID2", stored in the "MyExtractor_clone". In this case, value "ID2" can be used in both iterations because your application is designed to reuse the same value across iterations.
 
Does this make sense?

Cheers,
-Vadim
 
 
0 link






Copyright © 2017 Stimulus Technology