Forum Discussion

TSeieroe's avatar
TSeieroe
Contributor
16 years ago

conditional goto or groovy script

How should I go about doing the following

Do you have any examples?

if ( ${Response#ParameterValue} eq 'InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1' ) [
  # Set these variables
  InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.PortMapping.1.ExternalPort 9001
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.PortMapping.1.InternalClient 192.168.1.5
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.PortMapping.1.InternalPort 9001
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.PortMapping.1.PortMappingDescription Gaming
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.PortMapping.1.PortMappingEnabled 1
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.PortMapping.1.PortMappingLeaseDuration 0
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.PortMapping.1.PortMappingProtocol TCP
] elsif ( ${Response#ParameterValue} eq 'InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1' ) [
# Set these variables
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.PortMapping.1.ExternalPort 9001
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.PortMapping.1.InternalClient 192.168.1.5
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.PortMapping.1.InternalPort 9001
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.PortMapping.1.PortMappingDescription Gaming
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.PortMapping.1.PortMappingEnabled 1
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.PortMapping.1.PortMappingLeaseDuration 0
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.PortMapping.1.PortMappingProtocol TCP
] elsif ( ${Response#ParameterValue} eq 'InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.2' ) [
# Set these variables
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.2.PortMapping.1.ExternalPort 9001
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.2.PortMapping.1.InternalClient 192.168.1.5
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.2.PortMapping.1.InternalPort 9001
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.2.PortMapping.1.PortMappingDescription Gaming
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.2.PortMapping.1.PortMappingEnabled 1
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.2.PortMapping.1.PortMappingLeaseDuration 0
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.2.PortMapping.1.PortMappingProtocol TCP
]

3 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    hmm.. what are these "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.PortMapping.1.ExternalPort " values?

    generally, your condition check would be as follows:

    def value = context.expand( "${Response#ParameterValue}" )
    if( value == "..." )
    {}
    else if( value == "..." )
    {}
    etc..

    does that help?

    regards,

    /Ole
    eviware.com
  • So it is simular to Perl except for the specific def or reference to java beans/clases

    What I need to do is multipulate the returned from the response.

        WANIPConnection .vs. WANPPPConnection

    and the instance id as well

        WANPPPConnection.1.PortMapping
        WANPPPConnection.2.PortMapping

    I am using soapUI along with our API's to perform trying to automate our PD-128 Interoperability Testing base on the DSL Org.

    These parameters are defined within the TR-098 under the DSL Org as well as their vaild values.

    Sorry, I am about 60% completed and am now entering the more completicated tests.

    Terry
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Terry,

    ok, so you want to assign different values to a request based on a previous response?

    regards,

    /Ole
    eviware.com