#7 ServiceNow Automated Test Framework | Service Catalog in Portal Testing | ServiceNow ATF Training
[Music] in order to subscribe to my channel please click here or click here please share comment and like my videos and channel the next step configuration category is service catalog in service portal whatever forms you create and service catalog how exactly you can test those catalog farms in service portal now there are different step configurations for service catalog and service portal testing like open a record producer in service portal so wherever you see this SP that means service portal open a catalog item open an order guide add row' to multiple row variable set save current row of multiple variable set multiple row variable set set variable values will validate variable values now these are all for service portal with able state validation validate price and reoccurring price navigate with an order guide that is also on service portal set catalog item quantity review order guide summary review item in order guide add item to shopping cart add order guide to shopping cart order a catalog item submit an order guide and submit record producer so let's see how exactly you can perform service catalog testing in service portal so whatever forms you have created in service catalog which you are displaying on service portal how exactly you can do that let's go to my personal developer instance this is my personal developer insta so in order to perform this testing I will start creating first new tests that is ATF demo ATF demo for service catalog in portal I will save this so this is a new test I'm creating so I will click on add step and I will click on add step I will go to this category I have that is service catalog in service portal I will click here now you will see the first step configuration that is open a record producer that means you open the record producer in the portal so if you have any record producer in the portal in that case you will open this now how exactly you will do that for that we have to do we have to go to the portal so let's do one thing let's search for the portal first so I will look for portal I will see how many different portals I have I have this service portal I will go to the service portal let's click on try it so this is what we are going to test not the whole portal all the items in it so maybe for example I'm clicking on request something when I click here this is the Service Catalog portal where you will have all different catalog items so in this case what I can do maybe I can try to click on this one and create incident now this create incident is like a open record producer it's a record producer which will create an incident in this case let's test record producer so what exactly I need to do I will go to my test I will click here and then I will click on next I will click on next now here I can put that which particular record producer I have to open so you can see it is it has already selected portal it has already selected the page and here I have to select the record producer the record producer I would look for maybe let's click on the search here and I have this create incident here I have query parameters so if you want to give a query parameter there is a URL query parameter for the page maybe the society if you want to give that you can you can give right here now in this case I will do submit because this will just open the record producer let's run this and see what exactly happens if I click on run this will open up in a client rest runner now you will see it is running as a system administrator for now because I'm not I'm not impersonating anyone now you can see it has open that form so in this case we have two fields right here that one is urgency and another is please describe your issue below so in that case what I will do it says it got passed so in this case like user will go to the portal and open that particular record producer on the portal similarly it will also do that testing so now what I will do as of now I have opened that particular record producer so I will go for next step so next step is validating the variables because I will I will validate whether that particular variable is available or not so in this case I will use variable state validations and that's pretty much important here so what I will do I will click on next so first I will validate whether those two fields are available or not I maybe some of them are mandatory so I have this visible so for me visible is urgency and I have this descriptor sky below so this should be visible then I have not visible I don't need to do that I have a read-only no I don't have any and both are mandatory that means these two should be mandatory fields not freed only yeah I think if you want you can do that they should not be read-only that's it yeah I think this is what it is asking and the important part here is whatever catalog item or record producer you are selecting for the portal in the first step it is automatically showing the variables for that particular record producer so that's pretty much easy right user-friendly so you don't have to worry about searching for the variables for that particular record producer what I will do I will just click on submit so I have this so this will validate the states now I will fill the values that means I will set the values and that would be set variable values so in that case I will click on next and I will set the values so you can see this it has already selected the item that is create incident and here I will mention the variable values one is Arjun C so Arjun C I can put as maybe medium and then I have comments and I can just mention this is this is for ATF demo that said I will click on submit so it will fill the values now I have to submit this record producer now how exactly I can do that so you should definitely have that particular step and that is submit a record producer so if I click on next this will submit this particular record producer for me so it is successfully submitted record producer that's what you want to check so I will click on submit so in this case now you can see we have used four different step configurations and now I will click on run test let's see how exactly it works so this is our client test runner you can see it has opened the record producer on the portal it is validating the fields filling up the fields now and then submitting it you can see it says submitting and it's done the record producer has been submitted but it got filled let's see why rollback completed but the step got failed and we will see why exactly it got failed fail to submit the record producer okay if we check the screenshot maybe this is something we have to check it says fail to submit the record producer and what could be the reason so maybe if I put a medium and I put some test and I just submit it what can be the reason behind it let me check it is failed to submit the record producer if I check this error now this is interesting part because if your test is failing you have to validate the why exactly it is failing what would be the reason so it is able to set the values because that was the needed part here it says failed to submit the record producer okay we will go back so let's see if you can see the screenshot say it's submitting okay so it might be the reason because of the timeout so in that case I will go back to my record producer testing and here I will add timeout click on ok and I will give it maybe maybe I will give it 20 seconds let's try it again so clicking on run test let's see what happens okay and open the farm ready ratings filling up the fields and this time submitting it it is submitting it is waiting and it seems like it got passed yes said God passed so what was the reason and the reason behind it because this is this time I'd value is very important so maybe Paige was taking a little bit more time to submit the record producer and that was the main reason that that your test was basically failing so I just increase the time out value I gave it 20 seconds in that case it'll wait until it will pass it will wait at least 20 seconds until it gets passed so that is the most important feature I would say as part of the testing because all the tests might take some more time so we have used all these for now let's see other step configurations related to record producer if I if I select related to record producer I have that's it it's specifically for record producer now if I go to catalog items let's open a catalog item so in that case I will go back to my Service Catalog our sleeve and here maybe I have this Apple I will go to maybe software and I have this axis and I can just maybe order now but you have some like quantity you have some pricing delivery days and yes you have Add to Cart so what you can do you can click on open the catalog item I will click on next I will mention the catalog item as access let's see if I have that yes I do have I'm not putting any kind of parameter so I'm just opening that I'm adding another step and that should be order catalog item because I have to order but before ordering it should I change the quantity so I have this one I have this step configuration that is set catalog item quantity so I can click on next and I can change the quantity maybe five a little click on submit so I have used another one as well then I will click on add step again this time I will validate the price I will validate what price is it if I click on next so you can see it's one 39.99 so I will validate it so it's one 39.99 I want to validate whether it's correct or not so it's one 39.99 it should be true basically I don't have any kind of reoccurring price yeah I will just click on submit that's it so I've used this step configuration as well I will click on next add test step and this time so let's I think here I don't have to put any kind of fields basically so in that case I will check if I could do anything else quantity or a guide order guide add item to the shopping cart I think this this is kind of a good feature but let's let's first just submit it without adding to the shopping cart so in that case I will click on order a catalog item I will click on next successfully ordered catalog item and I will click on submit once I click on submit I will try to click on one test and now you will see all these things happening because it's just running the whole test we will disable it later on the other test like for example record producer test which we don't need for for this particular testing that is catalog item testing so that is submitted now you can see the opened access catalog item now it has set the value to 5 it is validating the price and it has also submitted it if I go here you can see it's again failing and all that reason is because of okay it says expected price to be 139 but it's oh that means that dollars to get this test checking the whole string so in that case I will open the record I think your you are getting these errors I think these these errors are helping you to understand better at how exactly this automation testing framework works so in this case I will change this value I will put here dollar and I hope that's yeah I have this dollar and I will update it I will also try to make it 20 20 seconds save it and what I will do I will try to inactive all these fields so I'm making it false this one as well because these are for or for a record producer so I'm just I have deactivated them and now I am running the test again I'm running it going back to my client test runner you will see it has opened the access setting the value to 5 validating the price and then ordering it you can see it is ordering now you can see it has also showing you the order confirmation and if I go back here it is passing is that means it is successfully or during that particular catalog item so it has passed the test so you can see we have used eight step configuration so if I click on test step now what I can do I will try to add this to shopping cart so I have this add items in that case I will do add to shopping cart so I will click on add item to shopping cart I will click on next successfully added to shopping cart so that means but you shouldn't you shouldn't submit it first in that case I have a litem to shopping cart and we can put this maybe set quantity after this maybe after validating a price yeah I can do this and I can submit it let's see if this item is added to the shopping cart so I have added it and if I go to next step then I think it's I can submit the shopping cart as well it says auto guys record add item and order guide reviewer items or items shopping cart and or a guide navigate with an order guide like other step configurations are related to order guide I think that said so let's end this and [Music] maybe you have to open another item maybe you have to add two items in that case I will go to software and you have more software like Acrobat let's add Acrobat as well so you go here add test step I will do open catalog item and that will be after add to shopping cart that catalog item would be Acrobat submit and then I'm just adding it at the shopping cart or the open a catalog item and I will click on next and I will submit it then I will click on add test step and how exactly I can submit the whole whole shopping cart and item the shopping cart I think that's it so let's let's try to run it so I will click on run test let's see what happens whether it is able to add into the shopping cart so it is opened setting the value we're adding price and added great so it has added now we have Acrobat you can see here we have this cart one two that means it is keep on adding and now it is submitting both the items and that's pretty much cool so it is able to order the whole item successfully the two klog items they have been added in the cart you have seen that it was keep on incrementing the numbers in the cart so one and then two and the whole test is successful so if I go to the test or all you can see we have about eleven steps now similarly you can do it for other guides as as well it's quite similar so but but the major part was showing you for racket producer submitting a catalog item and adding the items into shopping cart and that's how you do it so this is how you perform testing for all the Service Catalog items in service portal with the help of automated testing framework I hope you enjoyed this video thanks for watching
https://www.youtube.com/watch?v=5F8Oszs38a4