Karate -Generate random alphanumeric string in the current feature file
问题 I am trying to generate alphanumeric string of length 5 in Karate.I am trying the below code. Feature: Test user Background: Given url AM_HOST " * def random_string = function(s) { var text = ""; var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789"; for (var i = 0; i < s; i++) text += possible.charAt(Math.floor(Math.random() * possible.length)); return text; } * def sessionId = random_string(5) * print sessionId " >Scenario: Verify return user Given path 'user/<sessionId>' When method get