Forum Discussion

alibaba82's avatar
alibaba82
Super Contributor
17 years ago

Really puzzling issue when using soapUI with Microsoft Team Foundation Server

Hello,
We are using TFS for version control and check in our soapUI projects and groovy files into this system. I have one of my GlobalGroovy files checked in TFS. This file has a function which update the XML of some request.

The function is

void CreateRandomUser(context, String CreateUserRequestName)
{

Calendar c = Calendar.getInstance();
String timeStamp = c.get(Calendar.MONTH).toString() + c.get(Calendar.DAY_OF_MONTH ).toString() + c.get(Calendar.HOUR_OF_DAY).toString() + c.get(Calendar.MINUTE).toString() + c.get(Calendar.SECOND).    toString() + c.get(              Calendar.MILLISECOND).toString() ;
String UserName = "aaaaa" + timeStamp;
String Email = UserName + "@" + UserName + ".com";
String DisplayName = UserName;

def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( CreateUserRequestName + "#Request" )
//UpdateEmail
holder.setNodeValue( "//user:CreateUser/user:request/user:UserProfile/user:EmailAddress", Email )
//UpdateUserName
holder.setNodeValue( "//user:CreateUser/user:request/user:UserProfile/user:Username", UserName )
//Update DisplayName
holder.setNodeValue( "//user:CreateUser/user:request/user:UserProfile/user:DisplayName", DisplayName )

// update request with updated xml
holder.updateProperty()

}

The problem is that when I call this function, the value soapUI writes is not the one that is inside this function. soapUI seems to referencing some older file.

If I save the same function in another file, it works fine.

I am not sure if my explanation is clear. I think if I can show you over Webex that would be much easier. Not sure if the issue is with TFS or with soapUI

Thanks

Ali

2 Replies

  • alibaba82's avatar
    alibaba82
    Super Contributor
    Please Ignore. I had two files in the scripts folder whose name was different but the class name was the same. soapUI was fetching the method from one of the files which I did not anticipate. I made the class names unique and it works now.

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

    thanks for following up on this, I'll see if we can somehow detect this situation and show a warning..

    regards!

    /Ole
    eviware.com