Karate Framework Beginner Class 11: Post Method | Calling Java Code | Headers | Request Method

Publicado em: 24 Julho 2022
no canal de: Testing Tutorialspoint
171
3

Feature: sample karate test script

Background:
url baseURl
def jsonFiles = Java.type('com.demo.utill.UntillMethods')
def now = function(){ return java.lang.System.currentTimeMillis() }
#karate.readAsString('classpath:CreateUser.js')

Scenario: create user and then get the first user by id
Given path mainURl

def json = jsonFiles.jsonFile("CreateUser.js")
def name = 'Test-' + now()
replace json.userName = name
And request json
def headValues = { Authorization: 'Bearer 7232803c821bc49a0bd5c56d7df39c5289168e323fb17c5b6b1597d8941e33ef', Content-Type: 'application/json' }
headers headValues
When method post
Then assert responseStatus == 201
print response


Nesta página do site você pode assistir ao vídeo on-line Karate Framework Beginner Class 11: Post Method | Calling Java Code | Headers | Request Method duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Testing Tutorialspoint 24 Julho 2022, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 171 vezes e gostou 3 espectadores. Boa visualização!