header
Main Menu
Home
Eviware Store
Downloads
Products
News
Forum
Search
FAQs
Customer Area
Support
Documentation
Tutorials
CookBook
Downloads
Forum
Login Form
Welcome, Guest. Please login or register.
September 07, 2008, 09:15:51 pm
Username: Password:
Login with username, password and session length

Forgot your password?
 
Latest posts of: anu
Welcome, Guest. Please login or register.
September 07, 2008, 09:15:51 pm
Home Help Search Login Register
News: The Forums are up! Welcome to eviware.

  Show Posts
Pages: [1]
1  soapUI / soapUI / Running a Test Case from groovy script on: August 22, 2008, 01:13:29 am
Hi Ole

I want to run a test case. For that I have coded the following. But, I get compilation error. Can you pl. help me

testRunner.getTestCase().getTestStepByName("Step getSessionid").run(testRunner, context);
       
println("Finished Executing:");
              List stepResult=testRunner.getResults()
             Iterator j=stepResult.iterator();
             while (j.hasNext())
            {
                  TestStepResult result=(TestStepResult)j.next();
                  println("result:"+result.getStatus())
            }

The error is in "TestStepResult result=(TestStepResult)j.next();"

Also can you explain me why is testrunner being passed as parameter in the run method?

Thanks
Anu
2  soapUI / soapUI / Re: executing a step from groovy script on: July 15, 2008, 11:35:42 pm
Thanks.
3  soapUI / soapUI / Re: executing a step from groovy script on: July 14, 2008, 11:23:27 pm
Hi Ole

I am using the above script to read and write the properties. After the script is executed, I see the output as thus

<username xsi:type="xsd:string">
        a1
      </username>
      <password xsi:type="xsd:string">
        1
      </password>

When I try to run this, it does not work. But when I put them in one line as below
<username xsi:type="xsd:string">a1</username>
      <password xsi:type="xsd:string">1</password>

and then execute this step, it works. How do I write it in one line? or how do I take care of this problem. Any help will be greatly appreciated.

Anu
4  soapUI / soapUI / Re: executing a step from groovy script on: July 11, 2008, 09:03:17 pm
Thanks a lot.

I am able to get it working with testRunner.gotoStepByName( "Step 1 - open" );

5  soapUI / soapUI / executing a step from groovy script on: July 10, 2008, 10:44:47 pm
I am passing my parameters to the request object in say "Step 1 - open" using groovy script. How do I run the script.
Below is my script


// get request property
def openrequest = testRunner.testCase.getTestStepByName( "Step 1 - open" );
def openrequestproperty = openrequest.getProperty( "request" );

// parse out textnodes to modify
def node = new groovy.util.XmlParser(false,false).parseText(openrequestproperty.value);
def textNodes = node["soapenv:Body"]["x:open"]["abc"][0].children()

// modify
textNodes.clear();
textNodes.add( "test1" + System.currentTimeMillis() );

// write back to string
def writer = new java.io.StringWriter();
def printer = new groovy.util.XmlNodePrinter( new PrintWriter( writer ));
printer.print( node );

// set property
openrequestproperty.setValue( writer.toString() )

testRunner.gotoStepByName( "Step 1 - open" );

Now how do I execute "Step 1 - open".

Any help will be greatly appreciated.

Anu
6  General Category / eviware general / need help with setNodeValue on: January 26, 2008, 03:38:25 am
Hi,

I am new to soapui. I am trying to write a groovy script to read the data from a file and pass them as parameters to the request in the next step.

my xml in the second step is as follows

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ses="http://xyz.com/klm/session">
   <soapenv:Header/>
   <soapenv:Body>
      <ses:open>
         <ses:company>bbb</ses:company>
         <ses:username>aa2</ses:username>
         <ses:password>2</ses:password>
         <ses:userIpAddress>10.20.30.40</ses:userIpAddress>
      </ses:open>
   </soapenv:Body>
</soapenv:Envelope>

my groovy script in the first step is as follows
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )

//create holder for last response an log requistID
def holder = groovyUtils.getXmlHolder( "ses:company#request" )

log.info holder.getNodeValue

holder.setNodeValue( "//ses:company", "ccc" )

holder.updateProperty()

This however is throwing an error
Fri Jan 25 18:37:00 PST 2008:ERROR:org.apache.xmlbeans.XmlException: error: Unexpected element: CDATA

Can you pl. help me. I do not think I am doing it right.

Pages: [1]


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
header header
header
header