HomeSUPPORT QUESTIONS

Need help with StresStimulus? Start here.

Validator with parameter Messages in this topic - RSS

Unregistered User
Unregistered User
Posts: 203


4/4/2018
Unregistered User
Unregistered User
Posts: 203
Is it possible to use a Parameter within the "Text to search" field of a Validator?

I have a Microsoft Dynamics 365 script that searches for an Account, and then opens the Account returned. I've parameterised the name of the account being searched for. I would like to set up a Validator that checks for the account name searched for in the opened Account, rather than checking for some static text within the returned page. I've tried setting "Text to search" to {{Account.AccountName$Iter-Bound@@18}}, both with and without specifying it as a regular expression, but it fails, presumably because it's looking for that exact text rather than the value of the Account parameter for the current iteration.

Is there any way to achieve what I'm after, please? Thanks!
0 link
George @StresStimulus
George @StresStimulus
Administrator
Posts: 132


4/5/2018
George @StresStimulus
George @StresStimulus
Administrator
Posts: 132
In StresStimulus, the purpose of validators is to determine whether a request passed or failed. Almost always you can find some static content indicating that a request either pass or failed. For example, if page returns the text "the record not exist", it indicates failure. Or if page returns the text "customer name:" it means that this account is found. So a validator almost always can be created without using dynamic conditions, and this is the preferred and easiest way of using them.

However, if you need to implement a dynamic condition, StresStimulus has a level of programmability that provides maximum flexibility in script customization. For example, you can create an External Component containing logic that analyses a response the way you need and injects a static strings that then can be analyzed by one or several validators to raise an error or warning.

External Components are described here http://support.stresstimulus.com/display/doc48/Creating+External+Components
0 link






Copyright © 2018 Stimulus Technology