AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
DAX
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 23.10.2017, 20:13   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
axtoday: More on Postman functions
Источник: http://axtoday.blogspot.com/2017/09/...functions.html
==============

Continuing from my posts on Postman, here are some of the Postman functions that I use from time to time.


  1. To assign a value from the response to an environment variable:
    var json = JSON.parse(responseBody);
    postman.setEnvironmentVariable("bearerToken", json.access_token);


    In that example, it is assigning the access_token from the response to a variable called bearerToken
  2. Test conditions to decide the test result. This is to make it easier to see which request is failing and which one is not failing.
    tests["Status OK"] = responseCode.code == 201

    In this case, Status OK will be considered to be failed if the response status code is NOT 201.
  3. Randomise an integer between certain values
    _.random(1,5)

    In this case, it will return any integer number between 1 and 5.
  4. Randomise an integer value
    {{$randomInt}}

    In this case, it will return a random integer number.
  5. When you create a collection of requests in Postman, you can then run them using the collection runner. By default it will go by the request order in the collection. You can use this function to direct the sequence if you need to deviate from the default order:
    postman.setNextRequest("call name");
    If you put call that in the "Tests" script, then after running the current call, it will then run another call named "call name".

    postman.setNextRequest(null);

    The above will stop the execution.

    With this function you can basically call the same request more than once (for example to create multiple lines).
    Please note that this function only works in the Collection Runner.
In the next post, I will explain how to use Postman collection and environment data to do multiple concurrent calls, which will be very useful for performance tests.


Источник: http://axtoday.blogspot.com/2017/09/...functions.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
axtoday: How to do simultaneous request calls using Postman collections Blog bot DAX Blogs 0 23.10.2017 20:13
Navigate Into Success: Invoking Azure Functions from AL Blog bot NAV: Blogs 0 08.06.2017 15:11
axsa: Sprinkling a little bit of IoT around Contoso's Dynamics business process to make it more intelligent Blog bot DAX Blogs 0 02.03.2015 18:12
Microsoft Dynamics CRM Team Blog: New Xrm.Utility Functions in Update Rollup 8 for Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online Blog bot Dynamics CRM: Blogs 0 19.07.2012 01:11
NAV Team: Test Automation Series 2 - Creation Functions Blog bot Dynamics CRM: Blogs 0 04.11.2010 11:01

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 06:05.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.