- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on ā08-31-2018 01:50 AM
Many of us have the problem to automate the change process due to the Risk Assessment.
In the process you have to press the "Fill Out Risk Assessment" and "Execute Risk Calculation" UI actions for risk assessment in order to proceed with the test.
As far as I know, is not possible to interact with the popup of the questionnaire and to press it's submit button via the ATF available steps. I found some workarounds in the community (like changing the risk value by server side script) but i wanted the test to be complete and to test also the risk calculation based on the type of answers to the questionnaire and their weight.
First I looked at the record structure of a completed survey to understand needed tables, fields and relations. I noticed that the Instance is named with the "DateTime" of when the Submit of the survey was pressed, and is the same in all DateTime fileds in the records:
- The "Risk Assessment" is the record that the system looks at in first place. It's containing reference to the the change and to the instance which is the link to the question results
- Filed "Assessment" - select "Change Risk Assessment" (or how is nominated the survey)
- Field "Task" - Is the Change number
- Field "Completed By" - The user that took the survey
- Field "Completed Date" - The DateTime when the survey is inserted
- Filed "Instance" - The Instance of the survey. It's name is exactly the DateTime above
- The "Responses" are the records of each question, asnwer and answer weight and they are also related to the instance.
- Filed "Instance" - The Instance of the survey.
- Field "Question" - The Survey Question
- Field "Response" - The response to the specific question
- Field "Answer Integer" - The value of the specific response
- The "Instance" is the link between these records.
- Field "Taken On" - The DateTime as all above and also the name of the record
- Field "Survey" - The survey selected
- Field "Taken By" - the User that took the survey
So i decided to go this way, create a test case with this steps and it works:
- Impersonate a user
- Insert a change
- table: change_request
- Insert a record for the Survey Instance (choosing a DateTime and using it wherever needed in all records)
- table: survey_instance
- Insert a record for each Survey Question's Answer (we have 6 of them, i'll put only one in the screenshots)
- table: survey_response
- Insert a record for the Risk Assessment
- table: task_assessment
- Open the Change form
- Press the "Execute Risk Calculation" UI Action
Of course then i put those steps in a full End to End test case for the change process.
I think this is the best way, so far, to be able to complete a change test including also the risk assessment calculation (selecting different answers in different tests or re performing them in the same test) .
If anyone finds out a way to interact with the Risk Assessment popup please get in contact and tell me because it would of course be better and more simple.
- 11,070 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
thanks for doing the analysis! I will give this a go! š
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
In my London instance, we don't have a 'Execute Risk Calculation' UI button...I'm assuming this is needed to be able to complete the Risk Assessment bypass...
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi and thank you for your solution. I'm trying to make it work, but like Sean a while ago, I have the issue of no 'Execute Risk Calculation' button in Madrid. Have you developed this workaround further since a year ago or do you have an idea on how to make the test calculate risk and set it in the Change Request?
Your answer will be much appreciated!
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
We used this method for Change Survey prior to upgrading to Madrid, but updated to use Custom UI steps in Madrid. The issue with doing it all back end was that it didn't exercise the code used in the UI related to survey scoring, which we customized. Using Custom UI allows us to no longer need to "simulate" completing the risk survey, but instead it uses the actual UI. Our survey has 12 questions.
In conjunction with this we use paramaterized tests and are able to call both via a master test that acts as a modular data generator for all Standard Change tests.

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi jus,
Trying to follow this approach as well, but getting an error, "Cannot read property 'ownerDocument' of null" on the "Set Component Values (Custom UI)" step execution. Did you have this issue?
Thanks

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Issue was resolved by rerunning the Retrieve Components action and capturing a fresh "mug_shot".
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Lee,
We're facing the same error. can you please help me how to resolve in detail?
Thanks in Advance!!

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I wish I could be more specific. I only know that the error stopped after I reran the "Retrieve Components" operation and then re selected the Component values that I wanted to set.
NOTE: In its current state this method of processing an Assessment is still just "adequate". While it does seem to create the required records once the "Submit" button is clicked, I am not able to predict the precise behavior of the assessment. There is still MUCH room for improvement in the Custom UI Step Configurations. I have not reviewed Orlando on this topic yet.
Cheers,
Lee
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I thought may be its a time out issue - so gave 25 s timeout too but still failing
Any other idea or suggestion - my pop up window has 9 questions

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Sorry to say that I haven't learned anything new about this ATF Test Step. I recommend opening a case with HI Support on this behavior. They will need to work toward improving the behavior of ATF Steps involving surveys.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi ,
I had the same issue in calculating the risk , Hence I used the below server side script to set the risk.
var gr = new GlideRecord("change_request");
gr.setValue("short_description", "test");
gr.setValue("description", "test");
gr.setValue("risk", "1");
outputs.record_id = gr.insert();
risk-1 is critical, risk-2 is high and so on.
Thanks,
Rashmi