Postman runner "This request does not have any tests"

I do not understand this error. I do not want to run a test. I just want to perform a simple delete operation in Okta. I have never used Postman before. I can run a list of users using a pre-written Okta collection. Ithen tried the Okta delete uses with a small2-line .csv file and I keep getting this error. Code: [DELETE {{url}}/api/v1/users/{{username}}]. Postman runner Result: ā€œThis request does not have any testsā€.

Hey @steve.robey

Welcome to the community! :trophy:

So the message isnā€™t an error, itā€™s just informing you that, those particular requests, donā€™t have any Tests associated with them in the Tests tab in the Request Builder. It doesnā€™t impact the Collection run in any way.

The issue that I can see here is that the request is returning a 404 Not Found, as you are using variables {{url}}/api/v1/users/{{username}} it might be that those are not resolving during runtime.

HI Danny, Thank you for a quick response. I was just looking at the 404 Not found, and I think you are correct and my query is not finding the users. So I need to dive into why this is occurring as I know the two users in the .csv file exist. Okta provides the simplistic code including the name for the variable for the users, but they show it with two different names, once ā€œusernameā€ and once" userid". I have tried both and the preview of the .csv field looks ok. I have a call with Okta support this morning and although I know that Okta support people want nothing to do with customer code that deletes deactivated users, I hope I can figure out what is wrong. Here is the link to their sparse documentation: https://support.okta.com/help/s/article/How-to-bulk-delete-users-via-Postman,

Are you using the same CSV file from that article or one of your own?

Have you set the {{url}} variable anywhere else?

It looks like that CSV is only showing the {{username}} key/value so if the domain part isnā€™t resolving, it wouldnā€™t work.

If you click on the request name, in the image you posted, you will get more details about the request - This will show the resolved URL.

You should be seeing something like:

https://example.okta.com/api/v1/users/test1@rares.local

but if thatā€™s like this:

https:///%7B%7Burl%7D%7D/api/v1/users/test1@rares.local

Thatā€™s the issue. :smiley:

The ā€˜urlā€™ looks OK:PostmanError1
But the ā€˜usernameā€™ variable is ā€˜Unresolvedā€™. How do I fix this?PostmanError2

Is that the same environment file that you using during the Collection Run?

If youā€™re using the Collection Runner with a CSV datafile like this:

username
Danny
Steve
Bob

It will resolve that variable at runtime.

If youā€™re in the Request Builder, like I can see you are, you could add a new username variable to your environment file with the value of a user you want to Delete and try it out to see if itā€™s working as expected before moving to the runner again.

Hi Danny, you are definitely pointing me in the correct direction. Looking up and using the Using the Okta ā€˜useridā€™ (looks like ā€˜00u3565wcwJQN0pm62p7ā€™) in the Request builder works. But using the same code to run in the Collections run still cannot find the user. Even my Okta support person was unable to help me yet and will have to get back to me however. In the meantime I am going to punt with postman as I was able to get their PowerShell code to work correctly and delete the 2,800 deactivated users. Iā€™ll post back here if I ever get it to work correctly. The Okta document page that I referenced above is clearly not correct.

Note: I find it is better to use PowerShell to deactivate and/or delete a batch of users since it will deactivate the user and then delete it in a single pass. This script also creates a useful log file. See: delete-users.ps1 found here: https://support.okta.com/help/s/article/How-to-Perform-a-Bulk-Delete-of-Okta-Users-With-API

Reference: https://support.okta.com/help/s/article/How-to-bulk-delete-users-via-Postman

To use Postman, first set up an account. I created an account linked to my persoanl account. Then I set up an environment that I call ā€˜Okta Lumileds Productionā€™ with the correct URL and I generated the api key. You should also test your environment with the list user script first. Then I fount Oktaā€™s collections and found the delete user script under Users (Okta API) Ć  ā€˜Lifecycle Operationsā€™. To successfully run this ā€˜Delete Userā€™ script (Under ā€˜Lumileds above): DELETE {{url}}/api/v1/users/{{username}}

Hover over ā€œLumileds and then click on the ā€˜Playā€™ iconā€™ that appears:

Then Click Run:

This will open a new ā€˜Collection Runner Window and log you in in preparation for running the script. Verify the environment and select your .csv file. Example: 20200706_OktaDelDeaUsers.csv, containing:

username

Chandran.Varitharajoo@lumileds.com

Note: this is a deactivated user in Okta:

Click ā€˜Run Lumileds to see:

Ignore the ā€˜This request does not have any tests and ā€˜204 no Contentā€™ messages. The results are meaningless to. But the user is deleted:

{

ā€œidā€: ā€œ1acc82da-5c3b-40c3-a500-e1814bc93567ā€,

ā€œnameā€: ā€œLumiledsā€,

ā€œtimestampā€: ā€œ2020-07-06T19:53:09.134Zā€,

ā€œcollection_idā€: ā€œ2a5c9dd7-4700-4229-abe7-00ff95b6821eā€,

ā€œfolder_idā€: 0,

ā€œenvironment_idā€: ā€œa04ae03d-b150-4eeb-98bd-2135edd05c59ā€,

ā€œtotalPassā€: 0,

ā€œtotalFailā€: 0,

ā€œresultsā€: [

{

ā€œidā€: ā€œ5677947d-fdd9-4a22-9c5e-e71c1a2f714cā€,

ā€œnameā€: ā€œDelete Userā€,

ā€œurlā€: ā€œhttps://lumileds.okta.com/api/v1/users/Chandran.Varitharajoo@lumileds.comā€,

ā€œtimeā€: 945,

ā€œresponseCodeā€: {

ā€œcodeā€: 204,

ā€œnameā€: ā€œNo Contentā€

},

ā€œtestsā€: {},

ā€œtestPassFailCountsā€: {},

ā€œtimesā€: [

945

],

ā€œallTestsā€: [

{}

]

}

],

ā€œcountā€: 1,

ā€œtotalTimeā€: 945,

ā€œcollectionā€: {

ā€œrequestsā€: [

{

ā€œidā€: ā€œ5677947d-fdd9-4a22-9c5e-e71c1a2f714cā€,

ā€œmethodā€: ā€œDELETEā€

}

]

}

}

Hi All.

I just had exactly the same issue, after running the 404 was being returned. In my case what I did was making the API Call not with runner but just a ā€œnormal API Callā€, there I could see more details which finally helped me to solve the issue.

In my case, I need to specify a parameter that must be, letā€™s say: A or B or C. I was specifing type D, so of course, the type D was ā€¦ ā€¦ ā€¦ not found :slight_smile:

I hope it helps.