Forum Discussion

Anonymous's avatar
Anonymous
15 years ago

keyword testing : dynamic groovy script

hello,

I would like to do some keyword testing. So :
- It is possible to create a new testStep ?
- How to set the position of this new Step ?
- How to say that the teststep is a groovy script or transfert or a soap steps ?
- In case of groovy script testStep, how to set the value of the script ?
- Is it possible to change the script of known teststep ?

Thanks for any pointer.
PHL.

3 Replies

  • Anonymous's avatar
    Anonymous
    It is possible to create a new testStep ?
    Yes : via testCase.addTestStep(...)

    How to set the position of this new Step ?
    ??

    - How to say that the teststep is a groovy script or transfert or a soap steps ?
    The different teststeps are different objets. Try the in setup script :
    for (s in testCase.testStepList)
    log.info(s.getLabel()+" "+s.getClass()) ;

    - In case of groovy script testStep, how to set the value of the script ?
    setScript() and getScript() are defined on groovy testStep()

    - Is it possible to change the script of known teststep ?
    yes setScript()
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Peter,

    you can use testCase.insertTestStep( type, name, index ) to set the position of the TestStep, alternatively you can use testCase.moveTestStep( index, offset ) to move the TestStep at index by offset steps, for example moveTestStep( 2, -1 ) moves the third TestStep "up" one position..

    All others sorted out?

    regards!

    /Ole
    eviware.com