Runtime error when running tests: TypeError: Cannot read properties of null (reading ‘errorMessage’)
How do you deal with Runtime error when running tests: TypeError: Cannot read properties of null (reading ‘errorMessage’) in your Power Apps Test Studio?
Automated tests
Automated testing in Power Apps can reduce the time to test your app dramatically.
First of all the automated testing in Power Apps is still in preview. About 2 years ago I wrote a post about it, and as the automate testing depends on a preview feature being enabled in your app, we would have to take care when enabling this feature.
Today when I used the automated testing to just confirm that nothing broke as I made some updates, I found that even though my app was working I would get the testing tool to give me a failure.
This error isn’t very clear until you analyze the problem.
One of my steps is failing.
Identifying the issue
The problem here is that I have a Label, in a Gallery. However a label i a gallery can also work. In this case however I have a Label that sits inside a container.
The above Select however is trying to get the Label from the container. And even though the recording generated the above code. It ignores the container shell that sites around the Label control.
Fixing the issue
If we now try and fix this issue in the Test Studio, we will find out quite quickly that there isn’t a way to get to the Label2 or at least I haven’t found it.
Then I made a slight adjustment to my app. Rather than using a container I used a group instead. Groups and containers aren’t exactly the same but they are sometimes very similar.
And now my automated test runs successfully.
Continue Reading Pieter Veenstra’s Article on their blog
Runtime error when running tests: TypeError: Cannot read properties of null (reading ‘errorMessage’)
How do you deal with Runtime error when running tests: TypeError: Cannot read properties of null (reading ‘errorMessage’) in your Power Apps Test Studio? Automated testing in Power Apps can reduce the time to test your app dramatically. First of all the automated testing in Power Apps is still in preview.
Blog Syndicated with Pieter Veenstra’s Permission
More About This Author
Array
- Modern Workplace26 March 2024Receive the available storage within your SharePoint Online tenant
- Modern Workplace20 March 2024Options for Documenting Your Power Apps: Comments, Code, and Controls
- Modern Workplace18 March 20242 ways to duplicate SharePoint Lists to support your Power Apps
- Modern Workplace14 March 2024Update a Hyperlink Column in SharePoint with Power Automate