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
In questa pagina del sito puoi guardare il video online Karate Framework Beginner Class 11: Post Method | Calling Java Code | Headers | Request Method della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Testing Tutorialspoint 24 luglio 2022, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 171 volte e gli è piaciuto 3 spettatori. Buona visione!