Forum Discussion

alibaba82's avatar
Super Contributor
17 years ago

Really puzzling issue when using soapUI with Microsoft Team Foundation Server

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 context )
def holder = groovyUtils.getXmlHolder( CreateUserRequestName + "#Request" )
holder.setNodeValue( "//user:CreateUser/user:request/user:UserProfile/user:EmailAddress", Email )
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


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



2 Replies

  • alibaba82's avatar
    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.

  • omatzura's avatar
    Super Contributor
    Hi Ali,

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