Business Central 2024 wave 1 (BC24): Use in-client page scripting tool for acceptance testing

Dynamics 365 Business Central

Hi, Readers.
The public preview for Dynamics 365 Business Central 2024 release wave 1 (BC24) is available. Learn more: Link.

I will continue to test and share some new features that I hope will be helpful.

Use in-client page scripting tool for acceptance testing:

Business value:
With the page scripting tool, customers and consultants can easily record and replay user acceptance tests directly in the Business Central web client.

https://learn.microsoft.com/en-us/dynamics365/release-plan/2024wave1/smb/dynamics365-business-central/use-in-client-page-scripting-tool-acceptance-testing?wt.mc_id=DX-MVP-5004336

The page scripting tool in the Business Central web client allows you to record your actions, such as opening pages or entering data, and replay them. You can save the recording and share it with others for future playback. An important use case for the tool is capturing and executing user acceptance tests, which is also the initial focus for this release wave.

This feature was first announced and demonstrated at BC TechDays 2023.
More details: BC TechDays 2023 – Opening Keynote (1:25:03~1:30:27)

Yesterday Microsoft updated BC24 public preview with new builds, we can test it now.

In the web client, the page scripting tool is accessed from the Settings menu (cog wheel icon), the Page Scripting action. (Currently in Preview stage)

PS: Only appears if you have record or playback permission to use the tool.

The Page Scripting pane opens on the right, where you’re asked whether to start a new recording or to open an existing one to inspect or replay it.

To start recording your actions (in other words, start a user acceptance test), select Start new or select New > New recording in the toolbar at the top of the pane.

The page scripting tool will capture your on-screen interactions and the resulting actions, such as pages opening or closing, selections, data entry, and so on.

This also works for custom fields.

During recording, it’s possible to delete the last captured step.

Other captured steps cannot be deleted.

To stop the recording, use the Stop button in the toolbar. To resume to record more steps, select the round Start recording button in the toolbar.

During recording, you can manually insert special steps by right-clicking a page control, like a field, and selecting an appropriate option. These options are explained in the following sections.

The page scripting tool comes with its own clipboard that lets you copy field values and then, for example, insert them in other fields, use them in expressions, or use them to validate results. To copy and paste during recording, right-click a page control and select Copy or Paste from the context menu.
Copy:

Paste:

When recording, you have access to session information, such as the user ID. This allows you to, for example, set filters based on the current user. To insert the user ID, right-click a control in the page and select Paste > Session Info > User ID.

During the recording, you can insert validation steps to check the outcome when playing back the recording. To do this, right-click a control, such as a field or cue, and select Validate in the context menu.

This inserts a validation step with the current value.

If you want to change the value that’s validated, you can go to the validate step in the Page Scripting step list, select the context menu …, and select Properties.

Formula reference – Power Apps

Another option during the recording is to insert a conditional branch step. For example, suppose you only want some steps done during playback if there are no current rows in a list.

To insert a branch of conditional steps, right-click a page control, select Add conditional steps when, and then select an option.

After the conditional step has been inserted, you can add more steps that should be performed if the condition is met.

To end the condition branch, select End scope in the Page Scripting steps list.

The actual condition can be changed by selecting the condition step in the Page Scripting step list, expand the properties, and set the comparison rule and value.

During recording, as well as playback, you can edit a captured step in the Page Scripting pane using the context menu  on the step. The options in the context menu depend on whether you’re in the record or playback mode and the kind of step.

For example, some steps have properties, which include things like conditional steps or validation steps. You can see the properties for a step by selecting the Properties option from the context menu on a step.

Values and conditions can use expressions for simple calculations. Power Fx is used as the expression language. More details: Formula reference – Power Apps

Besides the Power Fx functions, three top-level objects are available:

  • Clipboard for access to the current entries copied in the recording.
  • Parameters for access to the value of any parameters passed to this recording.
  • SessionInfo for session information like current user ID.

Here are a couple of examples:

  • To validate that a previously copied value is incremented in a validate step, use the expression "Clipboard.'SO Processor Activities - ReadyToShip' + 1"
  • To generate a “random” name to use in an input step, use the expression "Customer " & Today().

Sometimes a page doesn’t always show in a recorded flow because it depends on data or settings. An example is the confirm dialog shown when closing a sales order. To handle this, you can make the page an optional page, which means that the steps under the page will only be run if the page is shown. To make a page optional, go to the Page Scripting step list, select the recorded step named Page X was shown, select the context menu , and select Make this an optional page.

The steps that occur on the page are indented to indicate that they’re optional, depending on page being shown.

To play a recording, whether you just captured it or you opened it from a file, select the Play button in the toolbar.

Test video:

During playback, you can do the following actions:

  • Go forward or backward a single step by using Forward and Backward buttons in the toolbar. When stepping backward, changes aren’t undone, though. You have to undo changes manually.
  • Go back to the beginning of the recording.
  • Run the recording as far as a given step. To do this, select the context menu  and then select Run to here.

As the steps are played back, the tool records whether they completed successfully (green check mark) or failed (red exclamation mark) and provides the result of any steps that validate a result.

You can save the recording from the toolbar. This creates a YAML file that you can download, share, edit, and reopen for playback.

You can select Open or select New > Open recording in the toolbar at the top of the pane to import the YAML file. (You can also drag and drop a recording file here)

You can share a recording as a link by selecting Share in the toolbar. The link includes the full recording and its playback result.

https://businesscentral.dynamics.com/c8558e71-6ad8-4fcd-9f29-3ca165b41bbe/do?company=My%20Company&bookmark=17_EgAAAAJ7_0MAMAAwADAANgAw&page=21&dc=0#open-replaylog=H4sIAAAAAAAAA8WY32_aSBDH3_NXjHgo7QMuNjYBjkbK0d4JKaFVoK0uLyfHXsCK8VrrJTnur7-x1z92_YM6IZf4IYrt2Z2Zz3xn10tg78gEbohDmesFmzOXRA7zQu7RYAIrEnFg-buI24xPzgBCRteej-N-_76cL74sl3B9ubj888sNmpAwik16wA8hWgT2g7exOcFHADh-Q5IZ4qsHob1Bk9k-4nRHGFx5EU_eKUEs0hmA09w0Ssx8usnmEqGB0TfMXn_Q042VoU_M4cQcadZocJtauXtmi0mHQ10KMnJoKCJ0aOB6iUk6RBjEgfaiLX0MMn90zxySGUFjJgBsH3BvR-buBO6C8EwEm0ISFIQLL3ig9ySfUEV1HFd2pa5uyLrwlY21HZH4jAacUf_vBXnM3wvXqyQM-blShnliFL8HGsDUsZPnF3g__Zjd5COlyhytzlizdP1WsiwqZI2sEqFKEaplyAqxJD5xeIFqRXahr6nEdtS1_Qlwti-oy8U6bOtBfEMPRf6pJxt47CKW6ZoyvA2Qk5O6LwDBox1BkoL2VFZWX9MHxu1zVdOGSEVDEgJZI1eU3u_Dr_dHhZIZKWo5QkuKosrtObCG5_XC0geWWacsx6cRcV9EWq8hI5lXEvnTFaVrlnVeVtQTuixnMLOZW-6rte1H9Y31r9-GSLzQ9FQXL9NHmPVoXO2jcM9btFF9ylKGonGkFOOxa4_4bryT7QoiD7a_J2nSSwEh2CQ7blNbYYQwTYZd1IyafhSvMBXcKAuM6POEPtK1oWE09NFYfwuIl67LSBSVOX7q5LN24B2sUISH9x9aoFTG2bvwt2ysAlSKJEebRnIS3dG4YZWy-uXt71XoXh_gj_i_Ml4xqXgHfb0F19KIBnlm_k6AaGjmYNQAcVBiiN95h14SyJHF7eV7PUg-spX50LK6HIjtNeIs_tquRTzDBIQtrBnifak-NzTLUJSIpDzi_vj1IqUsCW-4IIBRWRJmvhfeUZxS69ax77ZR8S-maLtIgHFacYaDhkXYLEv8zXayT0vME4PSut8jnHb-uQ3fypj_ZxsztHOzieBgVCKIAXhudmR9ZYiXn6_ni3puP9KwmqDAFA-xIqsLD3el4k7WpaCbuMlQP4PmWLcKmrkj1EAJZXGwjq_K4TqBmzGX1uQ65G2gH8MugZ8xgnHgJ_sO_76_mv31QbLL1Kz38ZKeS1l2LjrF9iGf5eXU1T5syqldVsfzkjL7tqUBntGpphikKXV0Y2BaHeVVc2cmxg3dmLupaUllxp9bIp3-qtyb1AsbRlDqTFbE1g5kUedxxnU6RcqWsjB4wZqqJcq-HFLtLihfYgQRElfLtMOlTFQyM4WAcnzMNfiJxxXyT4hHvHj_5FsS_x6zt_10K-_2u_GvW3ekJu8sd-gmmXbV0jaoMr6EP4KqKEsZUu8TEE9VEaxLB7H8N7fm41ebH-LGmmnqt2f_AQx416lwFAAA&zip=1&base64=1

In the following example, the playback has failed halfway through the recording. (It seems that the environment name is not included in the URL, and the Production environment will be opened by default)

Supported capture actions
The page scripting tool is focused on capturing actions coming from executing AL code. The tool isn’t a generic HTML automation tool. Therefore, it can’t automate elements such as control add-ins (like charts), embedded Power BI or Power Apps, or anything outside of the Business Central web client experience.

Great feature. Give it a try!!!😁

END

Hope this will help.

Thanks for reading.

ZHU

コメント

Copied title and URL