cancel
Showing results for 
Search instead for 
Did you mean: 

wait for user input then request trigger

Occasional Contributor

wait for user input then request trigger

Hi,

I want to wait for user input then add it to rquest and then trigger. as of now request is being triggered first then asking for input. Actually i want to sent user input into request.

Thanks in advance

 

groovy:

def usrIp=com.eviware.soapui.support.UISupport.prompt("Record Number","Answer");
testRunner.testCase.getTestStepByName("Properties").setPropertyValue("result",usrIp)
def ip=testRunner.testCase.testSteps["Properties"].getPropertyValue('result')

testRunner.testCase.getTestStepByName("Properties").setPropertyValue('name', ip)

2 REPLIES 2
Occasional Contributor

Re: wait for user input then request trigger

You can add groovy script before initiating your request.  This test step ( groovy ) will provide user prompt and once you have user Input store those values into properties. 

def selectedEnv = com.eviware.soapui.support.UISupport.prompt("Please select the enviornment", "Environment", ['X1', 'X2']) 

eg.. context.testCase.setPropertyValue('UserInputAsEnv', selectedEnv );

While Executing your Request ( which is step 2 in your test cases)

dynamically passed those variable .

eg..  <req:ReqEnvName>${=context.testCase.getPropertyValue('UserInputAsEnv')}</req:ReqEnvName

Contributor

Re: wait for user input then request trigger

You can import user data with text file or excel document. Then set this this value in properties and use it in your request data. Then you not be needed to wait for user input.

New Here?
Join us and watch the welcome video:
Top Kudoed Authors