Question
BPM Company
NL
Last activity: 6 Sep 2019 6:07 EDT
Automated UI Scenario Testing - System date question
Hi,
We leverage Automated UI testing feature capability introduced in Pega Infinity. We can create scenario tests and run these. Our application depends on some calculations depends on the current system date. So when we record the test case, it passes correctly. But for example when we run the same test case one month later, test case fails as calculated values are not the same with recorded values as they depend on the current system date.
As this may be a common impediment for scenario testing for different applications relying on the system date, is there a solution or guideline that how we can overcome this issue and run the Scenario test without failing when date is changed?
Thanks and Regards
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
Currently there is not out of the box way of simulating time. However if you can describe the setup of what you are trying to test in more detail we might be able to provide some ideas on how to effectively "simulate" the time.
The key aspect to testing anything that has a dependency on system time is to generally decouple or abstract the reference to time value in such a way that when testing, a simulated time can be supplied that is fully controllable. With some rule types in the system this is not easily doable, such as the SLA rule, but if there are ways, then we might be able to figure something out.
Pegasystems Inc.
IT
Hello,
we're facing the same problem thus run test with dynamic data instead static data in general.
For example with date i've recorded a test case inserting a date 01/01/2019. This date has a validation in the flow that prevents to insert dates one month before current. If we run the test now it fails.
It seems that provide dynamic data to automation is possible by reading this article https://community.pega.com/knowledgebase/articles/create-ui-based-tests-automated-scenario-testing that says "Provide data to your test cases with a predefined data page. This data page can provide unique values for each execution of the test case. You can populate the data page by using any source, including activities or data transforms."
Can you provide an example ?
Updated: 18 Mar 2019 2:50 EDT
Pegasystems Inc.
IN
Hi bertr,
Please follow the below steps which helps in configuring dynamic data to a scenario automation test case.
Providing Dynamic data to the test case
Hi bertr,
Please follow the below steps which helps in configuring dynamic data to a scenario automation test case.
Providing Dynamic data to the test case
We can provide dynamic data to the test case in the cases where we need unique values for each execution of the test case.
A predefined Data page D_pyScenerioTestData of type Page is made available to the user through which he/she can provide the dynamic values.
User can populate the DataPage using any source(activity/Data Transform/...) and he/she is supposed to set the dynamic values in the source.
If we use a Data Trasform say pyScenerioTestData to populate the DataPage, the Data Transform would look like
We can use the property populated above in the test case.
Provide dynamic data to the test case from test case rule form.
In this case, the test case needs to be recorded first.Then the dynamic data should be referred in the test case as shown below:
Next time the test case is ran, we see that "newdyncustomer" is entered in the Lastname field.We can also assert the dynamic values in the same way.
Provide dynamic data to the test case while recording:
The data which we have populated in the Data page can also be referred to while recording any test case.
Asserting CaseID' s using regex in test step assertions:
We can also assert the dynamic data like Case IDs which are not the same every time using a regex.This approach can be used when user need not want to assert the exact data but wants to assert the pattern of the data like CaseID.The data which changes needs to be replaced with {} as below:
Do let us know in case of any queries.
Thanks
Lavanya
De Volksbank NV
NL
I am trying to dynamically provide the data in the Scenario Test cases. I am fetching the value of .pyNote from a Data Page D_FetchNote but instead of reading the Data Page, the Test case is reading it as a string. I am unable to see/ download the screenshots you provided above. Can you please explain how did you pass the value using the Data Page..?
Pegasystems Inc.
IT
Hi,
it seems that D_pyScenarioTestData is the only Data Page that works, the other are interpreted as a text
guess you can fill D_pyScenarioTestData with data from D_FetchNote.
Roberto
Serendebyte Inc
CA
Hi Lavanya,
I dont have access to the attachement,
Infosys
IN
Hi,
Not able to access the attached screenshots. Kindly help
Thanks,
Sarika
Pegasystems Inc.
IN
Yes D_pyScenarioTestData is the only Data Page that works.But the source for the data page can be customized.
Thanks
Lavanya
Pegasystems Inc.
IT
As an example testing the generic "Service Request" case type.
Test case is sourced by DT that uses the 2nd element in another data page ( D_pyProductList1 ).
D_pyProductList1 is the source for the dropdown in the first section (step collect info) of the case
so the test case data is sourced dynamically and from available data.
This can be useful when you move test cases trough environments to avoid they fail because missing reference data.
Hope this helps
Best regards