I recently encountered a scenario on a very complicated SmartForm where, whenever I tried to add an ‘Execute another rule’ rule to my form, it presented me with this very weird error. It read as follows: Widget Error:Unable to get property ‘text’ of undefined or null reference.
K2 Automated Testing Software
BenchQA allows full test automation of K2, including fully automated K2 SmartForms and K2 Workflow testing. It promotes test driven development for K2 and ensures continued quality assurance for K2 solutions. Easily apply changes to test cases to accommodate changes to K2 apps and ensure all apps are regression tested to avoid defects and assure continuous quality.
The error can be seen below.
It took me quite a while to figure out what was wrong, seeing that I couldn’t find any existing resources referencing the error online. I am just briefly going to look at how I found the source of the problem, for in case someone else encounters similar issues as well. I believe the same process would be a suitable process to follow should you receive other Widget Errors, even if the property name is different.
Step 1. Make a copy of the form by Saving it under a new name.
This is to prevent us from changing our original form and deleting something we shouldn’t.
Step 2. Remove all form level rules one by one(or in groups), and after removing a rule, see whether you can add the rule now.
Step 3. Remove all views one by one, and after removing a view, see whether you can add the rule now.
Note: You need to do a check in and a fresh check out after removing a view/rule, or the error will persist – and you will be unable to identify where the issue were.
In the end my problem was the very inconspicuous rule below which broke everything:
Although I am still sure what the exact cause was – removing this rule, and re-adding it fixed the issue. I would therefore suggest starting by removing the rules that open sub-views or sub-forms.