Forum Discussion

dc_29_iib's avatar
dc_29_iib
Occasional Contributor
6 years ago

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)

  • ShasiSingh's avatar
    ShasiSingh
    Occasional Contributor

    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

  • 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.