ATF - End to End Testing - Can I condition whether a test step runs without a Manual touch?

TrenaFritsche
Tera Expert

I just about have a complete ATF test created for a custom change request process and I was hoping that there is a was to condition the running of a test step?  When a conflict is detected, I want to run the step to complete the text box of a conflict reason.  It does not display unless the result is a conflict.  It will fail if I try to set it with a value and it doesn't display, but it won't allow the form to submit without a reason.  The test can be ran with any CI so, the results could be different depending on the initial value and I was wanting to condition a step.  Is this possible? I have built other configuration steps to output values, but wondered if I can script with an update in a query during one of the steps?  I am going to be trying that but thought I would pose the question in case there is a simpler answer.

1 ACCEPTED SOLUTION

TrenaFritsche
Tera Expert

I was able to create a Step Configuration that runs on the Server and it updates the a pop-up text box value if it found that a conflict existed. If a conflict did not exist, no update is necessary.  This did what I was looking to do and I believe that many things can be accomplished if one does not take defeat by someone telling them that it can't be done!  More often than not, with ServiceNow...it Can be done!  (Just got to figure out how!) LOL

I hope this helps others work through ATF complications.  Please see my other postings about building configurable steps that may help in other ways!

https://community.servicenow.com/community?id=community_question&sys_id=99eec835dbc89c5c6064eeb5ca96...

View solution in original post

3 REPLIES 3

Kieran Anson
Kilo Patron

One of the learns from the NowLearning Automated Test Framework (ATF) Fundamentals (Orlando) is to avoid conditional testing to make things easier and rather make multiple tests as part of a test suite.

Quote from training "There really is no need for conditional logic in ATF tests. If I ever come across a situation where I want to perform some test steps based on a given criteria or branch a test along different paths, I just create a separate test for each condition. Keep it simple."

Hello Kieran,

As much as I appreciate your reply, I think that one benefit that can be obtained through ATF is to build a "Happy Path" Test which could involve verifying if a condition exists.  Your answer definitely applies to testing a skeleton form that doesn't have special processes or if you are just testing for a true condition.  I am basically creating a full end to end test script automation that requires an entry in a field only if it exists before it can be saved.  I am building a test that should always complete successfully.  I ended up creating a configuration step that runs after the Conflict Checking process.  This step actually checks the result of the conflict check and if there is a conflict, an text update occurs to the field (conflict justification) that is now required thru a scripted query.  When a conflict doesn't exist, no update occurs.  This allows the form to submit.

If I would have tried to set a value for the justification just in case there was a conflict, the test would fail when there isn't a conflict as not justification field will be on form.

How would this scenario been handled by a test suite?  Maybe I am missing something?

Thanks 

TrenaFritsche
Tera Expert

I was able to create a Step Configuration that runs on the Server and it updates the a pop-up text box value if it found that a conflict existed. If a conflict did not exist, no update is necessary.  This did what I was looking to do and I believe that many things can be accomplished if one does not take defeat by someone telling them that it can't be done!  More often than not, with ServiceNow...it Can be done!  (Just got to figure out how!) LOL

I hope this helps others work through ATF complications.  Please see my other postings about building configurable steps that may help in other ways!

https://community.servicenow.com/community?id=community_question&sys_id=99eec835dbc89c5c6064eeb5ca96...