Highlighted
Absent Member.
Absent Member.
1723 views

how to capture ordinal value with same boundary values

Hi All,

I am trying to capture ordinal value from the below request and having same left and right boundaries in responce body. Currency and Header Account number fields will change every time and I am writing custome request to handle this dynamic request. But iam not able to capture Currency ordinal and Header account ordinal seperatly due to same boundaries. Can any one suggest on this.?

"Name=StructureTypeOptions[0].Key", "Value=MCP", ENDITEM, 
        "Name=StructureTypeOptions[0].Value", "Value=MCP:Multi Currency Pool", ENDITEM, 
        "Name=StructureTypeOptions[1].Key", "Value=SCP", ENDITEM, 
        "Name=StructureTypeOptions[1].Value", "Value=SCP:Single Currency Pool", ENDITEM, 
        "Name=StructureTypeOptions[2].Key", "Value=CC", ENDITEM, 
        "Name=StructureTypeOptions[2].Value", "Value=CC:Cash Concentration", ENDITEM, 
        "Name=CurrencyOptions[0]", "Value=AED", ENDITEM, 
        "Name=CurrencyOptions[1]", "Value=AUD", ENDITEM, 
        "Name=CurrencyOptions[2]", "Value=CAD", ENDITEM, 
        "Name=CurrencyOptions[3]", "Value=CHF", ENDITEM, 
        "Name=CurrencyOptions[4]", "Value=CZK", ENDITEM, 
        "Name=CurrencyOptions[5]", "Value=DKK", ENDITEM, 
        "Name=CurrencyOptions[6]", "Value=EUR", ENDITEM, 
        "Name=CurrencyOptions[7]", "Value=GBP", ENDITEM, 

"Name=HeaderAccountNumberOptions[0]", "Value=10070092", ENDITEM, 
        "Name=HeaderAccountNumberOptions[1]", "Value=10615242", ENDITEM, 
        "Name=HeaderAccountNumberOptions[2]", "Value=10615250", ENDITEM, 
        "Name=HeaderAccountNumberOptions[3]", "Value=10615269", ENDITEM, 
        "Name=HeaderAccountNumberOptions[4]", "Value=10615277", ENDITEM, 
        "Name=HeaderAccountNumberOptions[5]", "Value=10615285", ENDITEM, 
        "Name=HeaderAccountNumberOptions[6]", "Value=10615293", ENDITEM, 
        "Name=HeaderAccountNumberOptions[7]", "Value=10615307", ENDITEM, 
        "Name=HeaderAccountNumberOptions[8]", "Value=10804673", ENDITEM, 
        "Name=HeaderAccountNumberOptions[9]", "Value=10804681", ENDITEM, 
        "Name=HeaderAccountNumberOptions[10]", "Value=10804703", ENDITE

"Name=EquivalentCurrencyOptions[0]", "Value=AUD", ENDITEM, 
        "Name=EquivalentCurrencyOptions[1]", "Value=BRL", ENDITEM, 
        "Name=EquivalentCurrencyOptions[2]", "Value=CAD", ENDITEM, 
        "Name=EquivalentCurrencyOptions[3]", "Value=CHF", ENDITEM, 
        "Name=EquivalentCurrencyOptions[4]", "Value=CNY", ENDITEM, 
        "Name=EquivalentCurrencyOptions[5]", "Value=CZK", ENDITEM, 

Replay log output:

Action1.c(527): Notify: Parameter Substitution: parameter "C_Value_1" = "AED" Action1.c(527): Notify: Parameter Substitution: parameter "C_Value_2" = "AUD" Action1.c(527): Notify: Parameter Substitution: parameter "C_Value_3" = "CAD" Action1.c(527): Notify: Parameter Substitution: parameter "C_Value_4" = "CHF" Action1.c(527): Notify: Parameter Substitution: parameter "C_Value_5" = "CZK" Action1.c(527): Notify: Parameter Substitution: parameter "C_Value_6" = "DKK" Action1.c(527): Notify: Parameter Substitution: parameter "C_Value_7" = "EUR" Action1.c(527): Notify: Parameter Substitution: parameter "C_Value_8" = "10070092" Action1.c(527): Notify: Parameter Substitution: parameter "C_Value_9" = "10615242" Action1.c(527): Notify: Parameter Substitution: parameter "C_Value_10" = "10615250" Action1.c(527): Notify: Parameter Substitution: parameter "C_Value_11" = "10615269" Action1.c(527): Notify: Parameter Substitution: parameter "C_Value_12" = "10615277" Action1.c(527): Notify: Parameter Substitution: parameter "C_Value_13" = "10615285" Action1.c(527): Notify: Parameter Substitution: parameter "C_Value_14" = "10615293" Action1.c(527): Notify: Parameter Substitution: parameter "C_Value_15" = "10615307" Action1.c(527): Notify: Parameter Substitution: parameter "C_Value_16" = "10804673" Action1.c(527): Notify: Parameter Substitution: parameter "C_Value_17" = "10804681"

0 Likes
6 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: how to capture ordinal value with same boundary values

Hi

I'm not 100% sure what you mean, but will give it a try to understand more.

To be able to find how to correlate, you/we need to examine to server response and see how the boundaries look. This codesnip looks more like the following call in vugen.

If the boundaries are the same, then maybe it is possible to extend the boundaries and use
web_reg_saave_param_regexp() instead, that will give more possibilities

br /ola


Please mark post as solved if your problems or questions is/are resolved.
If this post was valuable to you, please consider kudo it.

 

 

.
0 Likes
Highlighted
Super Contributor.
Super Contributor.

Re: how to capture ordinal value with same boundary values

Hi,

I am assuming “you are getting 7 currencyoptions and 10 Accountnumberoptions per each iteration (no dynamic changes) and you have to select  the random value from each  and you have pass those random values in the next request”

Create two “Random number” type  parameters: 

                                           1) Currency_1to7   ====> Mim =1 and Max =7

                                           2) Accno_8to17      ====>Mim =8 and Max =17

Write two correlation function, give the above two parameter name as ordinal values

web_reg_save_param_regexp("paramname=Currency ",
                              "regexp=",
                              "ordinal={Currency_1to7}",LAST);
    web_reg_save_param_regexp("paramname=Accno ",
                              "regexp=",
                              "ordinal={Accno_8to17}",LAST);

So randamly it well select 1-7 for currency and 8 to 17 for Accno..

Thanks,

Ravi

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: how to capture ordinal value with same boundary values

Hi Ola,

Please find the server responce below.

<option value="" selected="selected" class="c-js-placeholder">
        All
       </option><option value="AED">
        AED
       </option><option value="AUD">
        AUD
       </option><option value="CAD">
        CAD
       </option><option value="CHF">
        CHF
       </option><option value="CZK">
        CZK
       </option><option value="DKK">
        DKK
       </option><option value="EUR">
        EUR
       </option><option value="GBP">
        GBP
       </option><option value="HKD">
        HKD
       </option><option value="HUF">

<option value="" selected="selected" class="c-js-placeholder">
        All
       </option><option value="10070092">
        10070092
       </option><option value="10615242">
        10615242
       </option><option value="10615250">
        10615250
       </option><option value="10615269">
        10615269
       </option><option value="10615277">
        10615277
       </option><option value="10615285">
        10615285
       </option><option value="10615293">
        10615293
       </option><option value="10615307">
        10615307
       </option><option value="10804673">
        10804673
       </option><option value="10804681">
        10804681
       </option><option value="10804703">
        10804703
       </option><option value="10813710">
        10813710
       </option><option value="10813729">
        10813729
       </option><option value="10813737">
        10813737
       </option><option value="10813745">
        10813745
       </option><option value="11175076">

 

because of same boundaris, Iam unable to capture Currency and Header Account numbers seperatly. Please advise

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: how to capture ordinal value with same boundary values

Hi Ravi,

Currency and Header account numers fileds will change every time. it is a dynamic page

0 Likes
Highlighted
Super Contributor.
Super Contributor.

Re: how to capture ordinal value with same boundary values

Hi,

Try any one of the below, it may work in your case

1)  Regexp: 

         Currency:   <\/option><option value=\"(.*?)\">\n\s*[A-Z]+

                            </option><option value="AUD">AUD

                           Consider second AUD as left boundary

        AccNO  :     <\/option><option value=\"(.*?)\">\n\s*[0-9]+

                         </option><option value="10070092"> 10070092

2) Regexp

          Currency:   <\/option><option value=\"[A-Z]+\"> 

          AccNO  :     <\/option><option value=\"[0-9]+\">

Thanks,

Ravi

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: how to capture ordinal value with same boundary values

Hi

As the currency is 3 letters and account number is 8 digits, it should work with web_reg_save_param_regexp
Something like this, check the documentation:

web_reg_save_param_regexp (
    "ParamName=Currency",
    "RegExp=<option value=\"([A-Z]{3})\">,
    "Ordinal=All",
	SEARCH_FILTERS,
    "Scope=Body",LAST );

web_reg_save_param_regexp (
    "ParamName=HeaderAccountNumber",
    "RegExp=<option value=\"(\d{8})\">,
    "Ordinal=All",
	SEARCH_FILTERS,
    "Scope=Body",LAST );



br /ola


Please mark post as solved if your problems or questions is/are resolved.
If this post was valuable to you, please consider kudo it.

 

.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.