Do I need to parameterize here and ask for test data?

54 views Asked by At

I have a situation where I am testing a CRM application where when I click on an accounts tab, it pulls a bunch of information and passes parameters to fill it.

For example, something like deposit accounts :

<div style='display:none' id='AJAXCT_3_TABTHREAD1'>

   {"ID":3,"p":1,"Initial":{"D_DepositAccountList_pa5493899103423pz":{"pxResults(1)":{"AccountNumber":"54324932","pyText":""}}},"Values":{},"Pages":[],"AddRemove":[],"WatchRemoved":[],"RequestorWatchRemoved":[]}

</div>

The account number is what will show on the UI. It seems to do another ajax call that does the same thing for however many accounts it has. For example :

<div style='display:none' id='AJAXCT_3_TABTHREAD1'>

   {"ID":3,"p":1,"Initial":{"D_DepositAccountList_pa5493899103423pz":{"pxResults(10)":{"AccountNumber":"","pyText":""}}},"Values":{},"Pages":[],"AddRemove":[],"WatchRemoved":[],"RequestorWatchRemoved":[]}

</div>

After it doesn't return a result on pxResults(10) (10th account so there is only 9), it moves onto to the next set of accounts potentially in the list. Like a business loan account.

It has this in its body data but it is a POST request

D_DepositAccountList_pa5493899103423pz.pxResults(2)

This is also in the same calls for each of those:

    <div bSimpleLayout='true'  class='flex  content  layout-content-mimic_a_sentence content-mimic_a_sentence margin-r-3x'    ><div  style=''  class='content-item content-field item-1   dataValueRead flex flex-row '  STRING_TYPE='field' RESERVE_SPACE='false'><span ><a  data-test-id='543543578979' href='#'onclick='pd(event);'  data-ctl='Link' name='DisplayAccountNumberWithActions_D_DepositAccountList_pa5493899103423pz.pxResults(1)_1' data-click='[["runDataTransform", ["PrepareTransactionHistory", "=", "D_DepositAccountList_pa5493899103423pz.pxResults(1)",":event"]],["showHarnessWrapper",["popup","RANDOMCOMPANY-Data-Account","TransactionHistory","","","D_DepositAccountList_pa5493899103423pz.pxResults(1)","No","scrollbars=yes,resizable=1,width=,height=","",{&quot;pyDataTransform&quot;:&quot;SetAccountDetailsTransactions&quot;,&quot;pyDataTransformParams&quot;:{}},":event","","","","","","false"]]]'  class='' >54324932</a></span></div><div id="CT" SWP=".AccountNumber"  SHOW_WHEN=".AccountNumber != ''" style=' '  class='content-item content-field item-2   dataValueRead flex flex-row '  STRING_TYPE='field' RESERVE_SPACE='false'><span ><i class='icons'><img   data-test-id='23034020340213'   data-ctl='Icon'  src='webwb/gegwegewg_1112051703.png!!.png' tabindex='0' role='link' name='DisplayAccountNumberWithActions_D_DepositAccountList_pa5493899103423pz.pxResults(1)_3' alt= '' data-click='[["runDataTransform", ["SetAccountNumberToCopy", "=", "D_DepositAccountList_pa5493899103423pz.pxResults(1)",":event"]],["runScript", ["copyToClipboard(\"#~D_DepositAccountList_pa5493899103423pz.pxResults(1).pyText~#\")"]]]'  /></i></span></div></div>

It will usually do about 2-3 ajax calls where it looks like it is filling the website via XML and another one where it passes a bunch of parameters/data in json format but not sure what it does.

<span>
   <span data-test-id='532535235235' data-ctl='Text'class='rightJustifyStyle'>$250,000.00</span>
 </span>

Maybe the data-test-id is important?

Depending on the account, it seems to only do ajax requests to fill out the dynamic layout for something like loan account or business loan account before it does the pxResults(1) ajax calls if it is present in the test data i am using;however, i don't know how it is "dynamically" deciding which ones to call.

<div data-template-name='DynamicLayout' data-template-instance-id='532535235235' CLASS='template-root-marker'></div>
<div id="pyCustomError" style="display:none;">
    <div data-template-name='pxSection' data-template-instance-id='5435453453' CLASS='template-root-marker'>
        <div id='65465465462' style='display:none'></div>

This also shows up in the string query for a lot of the ajax requests D_DepositAccountList_pa5493899103423pz.pxResults(1) specifically the pa5493899103423pzdepending on the account.

Not exactly sure if I have to have test data that I know will load specific things ahead of time and parameterize it based off of that. I'm just trying to see if i can make it more dynamic essentially because imagine I have 1 test data that loads 20 different account numbers, but say i have 30 people now.. that can multiple quickly and is hard to manage i assume.

1

There are 1 answers

0
Dmitri T On

I think it's some form of pagination so the data on accounts is being requested in "chunks", normally it's being done to limit the size of the requests and to prevent potential DOS attacks putting the server on knees by asking to return hundreds/thousands of entities.

In order to parameterize your requests you will need to locate the AJAX request which fetches the either metadata or first chunk of the account. Normally the response should contain the number of results, the current "page" and whether other "pages" are available. The suitable test element for simulating this is While Controller

With regards to data-test-id I cannot state what it's use, my assumption is that it's some form of service information which makes easier functional automated testing of the CRM using browser automation frameworks like Selenium or Playwright