Search This Blog

October 22, 2014

Parasoft SOAtest: Change the default lock level to Check Out- Prevent other users from checking out and checking in

SOAtest doesn’t integrate with TFS very well and it has the merge issue. Only 1 person can check out one tst file. If 2 persons are working on the same tst file, once A checks in, B will lose his work. In this situation, when we check out the tst file,  we always select lock type- Check Out- Prevent other users from checking out and checking in.


However, the lock type of unchanged-Keep any existing lock is showing up by default. How can we change it to what we want? Here are the easy steps:  

Launch SOAtest-> Click Window->Preference->Team-Team Foundation Server->Source Control-> Choose Check Out- Prevent other users from checking out and checking in.



Next time if you would like to check out the tst file, it will show up by default .

October 16, 2014

SOAtest: Environments setting is below Test (.tst) [bad design]

In Parasoft SOAtest , if I create 1 Test (.tst) file , Environment is added below the .tst file automatically. I can switch to another environment (DEV, TEST, UAT..)  manually. What if I have 10 .tst files? It means that I have 10 environments.


If our developers change the data contracts in some WCF methods and I need to do regression tests in DEV environment first. In this situation, I need to manually change 10 times to point to DEV from TEST. After testing in DEV and we push a new build to TEST, I need to change 10 times back to TEST again.

Why not have a global environment where we can change it one time only?  I would say Environments setting below Test (.tst) is the bad design.


SOAtest, you should make your own product more user-friendly. 

October 10, 2014

Fixed the issue in SOAtest: Element could not be located or did not contain text content.

In SOAtest, I always select Value Assertion from XML Assertor to validate the data accuracy in WCF response format. Recently I have seen the following error message very often. For example,

Element "../PhoneNumberTen" could not be located or did not contain text content.

If I Click “Evaluate XPath” button, “No nodes found” message appears.



If I view the response data in the Traffic Viewer, PhoneNumberTen is blank. It means when the value is blank, SOAtest regards it as “No nodes found”.


Because the data is dynamic from SQL Server, it is possible to make the test failed due to the issue above. How do I fix this issue?

Add a new Conditional Assertion and use the following condition.

If Has Children Assertion = true

Then validate the value of PhoneNumberTen


It means when the data is blank, the validation will be ignored. 

After using this condition above, the tests pass!

October 9, 2014

Fixed the issue: Use Has Children Assertion to validate part of a string in SOAtest

Our Developer changed the error message in the WCF response format. Due to the long Error Message, how did I validate the error message in SOAtest? The best way in my mind was to contain some keywords such as System.NullReferenceException in SOAtest. 


Long Error Message

Text: System.NullReferenceException: Object reference not set to an instance of an object.   at
.................
System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)




Could SOAtest handle “String Contain”  like C#?  After looking into this interesting issue, I set up the following variable.



I tried “Has Content Assertion”, and it didn't work. I tried “Has Children Assertion" and it worked perfectly.  I would say it is nice to validate part of a string via Has Children Assertion in SOAtest.



September 26, 2014

Need to reconfigure all settings in SOAtest after TFS 2013 upgrade

Our IT department was doing TFS 2013 upgrade last weekend.  After TFS 2013 upgrade, our team saw some issues of SOAtest this week.

When opening SOAtest, I lost the connection to TFS and it showed the error message all the time.

Another team member could connect to TFS in SOAtest , but she could not get the latest version on the project level because “Get Latest version” or “Get Specific Version” was disabled. The interesting part was that she could still get the latest version in the individual tst file. But that was not helpful.

We need to fix this issue as soon as possible. Therefore, the best way to fix this issue is to create a workspace, import all test cases from TFS and reconfigure the settings. Here are the simple steps:

1)    Create a folder in C drive.

2)    Open SOAtest and use that folder as a workspace.

3)    Click file ->import and I can import all test cases from TFS.

4)    Click Parasoft->Preferences and reconfigure all required settings .

5)    Run BVTs and validate if all tests pass.




Another member mentioned that after TFS 2013 upgrade, if we used SOAtest to reconnect to TFS 2013, we should not be able to see the issues above. I totally agreed. 

Why bother testers to reconfigure all settings in SOAtest after TFS 2013 upgrade? 

September 22, 2014

Parasoft SOAtest issue: the characters after & are truncated in Traffic Viewer-Response- Element

This morning I noticed one test failed in SOAtest. After looking into this issue, I have the confidence to say this is the bug on SOAtest side.

We have the SQL query to get the test data and then pass the data in WCF method.

SQL query:

@Name VARCHAR (100)

….Where RTRIM (Name) like '%&%' (Initially we didn’t have this condition .I added it.)

Test Data:

It contains “&” . For example, Name is Ray FURNITURE & EQUIPMENT

SOAtest (DB tool)

Click Traffic Object -> Traffic Viewer-Response-Literal

Ray FURNITURE & EQUIPMENT

Click Traffic Object -> Traffic Viewer-Response-Tree

It doesn’t show the tree nodes. It only shows NewElement.



Click Traffic Object -> Traffic Viewer-Response- Element

results:
  resultSet:
    rows:
      row:
        Name: Ray FURNITURE

I used different data with & several times and I noticed that the result only showed the characters before &. I believe the characters behind & were truncated in SOAtest.

I used different data without & several times and the complete data appeared.


Next time if you see this & issue, don’t feel surprised in SOAtest.

September 19, 2014

Fixed SQL Query: Adding Group By When Using ROW_NUMBER ( )

If we have ROW_NUMBER ( )  in SQL query, using SELECT DISTINCT shows the duplicate record.

SQL query

SELECT DISTINCT
COL1 AS ID,
ROW_NUMBER( ) OVER( ORDER BY COL1) AS RowNum,
COL2 AS FirstName
FROM table
INNER JOIN table ON xx=xx
INNER JOIN table ON xx=xx
INNER JOIN table ON xx=xx
INNER JOIN table ON xx=xx
WHERE ...

Result:


  
How can I remove the duplicate record when using ROW_NUMBER( ) in SQL query? The answer is to use Group By.

Modify SQL query: adding Group By
SELECT
COL1 AS ID,
ROW_NUMBER( ) OVER( ORDER BY COL1) AS RowNum,
COL2 AS FirstName
FROM table
INNER JOIN table ON xx=xx
INNER JOIN table ON xx=xx
INNER JOIN table ON xx=xx
INNER JOIN table ON xx=xx
WHERE ...
GROUP BY COL1, COL2

Result:

September 15, 2014

Fixed the issue- Order by string ( 1,11,2,21,3), not by number (1,2,3,4)

Today I ran the SOAtest and found one test failed.I checked the SQL query and it used 
Order by FieldName. The data is returned as follows (order by string)

1149
1180
1339
135
1365
140
23
.....

When I opened WCF test client and invoked the web service, it returned the following data (order by number)

23
53
60
78
135
140
271
292
453
.....

After looking into this interesting issue, I modified the following SQL query and it is working perfectly.


Order by FieldName *1

August 28, 2014

Fixed the issue in SQL Server 2008- Conversion failed when converting date and/or time from character string.

Today when I executed one SQL query, sometimes it worked, but sometimes it didn’t. It showed the following error:

Conversion failed when converting date and/or time from character string.

After looking into this interesting issue, I found the SQL query used

CONVERT(char(20),FieldDateName,127)

In SQL Server 2008, it is better to use CAST and Datetime2 Type. After using the following way, the error disappeared.

CAST(FieldDateName as Datetime2)

August 27, 2014

WCF: Skip Take Sort in SQL Server 2008

In WCF method, we have an interesting feature called Skip Take Sort.

If we input one member ID, skip=30, take= 40, sort by one Field name and then consume the WCF , the data for that member returned will skip first 30 rows and take the next 40 rows after a sort. 

How can I do it in SQL query? Here is the simple example : Skip 1 and Take 3 after a sort.. It is working perfectly.