Ask a Question

Using Project Property as a value for JMS Timeout Assertion

SOLVED
mileppaa
Occasional Contributor

Using Project Property as a value for JMS Timeout Assertion

Hi,

 

I just changed my old soap ui (5.0) env to this latest version, Soap Ui 5.2 (x64,free Open Source).

 

I imported my old test project where I have been using this Project Property (TestRequest Property Timeout is ${#Project#Timeout}) as a value for JMS Timeout Assertion (One timeout value used for all my Requests).

 

Now, when started to run my test cases, all request fail as Timeout for JMS Timeout Assertion uses value 100 ms... And my project property was set to 60000 ms.

Ok, I started to check my testprojects JMS Timeout assertions and noticed that the timout cannot use Project Property as a value 😞 Oh noes.. It seems to only accept the decimal value so only thing you can add there is numeral values, not string value like ${#Project#Timeout} is. Also adding this JMS Timeout assertion uses a new dialog which uses this 100 ms as a default value (you can put ${#Project#Timeout} to that insert field put it's not added to Request Properties...).

 

Has anyone else noted this?
I did some searching to this forum and noticed from release notes that some changes have been made to this JMS assertion but I am not sure did that change cause this behaviour?

 

 

5 REPLIES 5
nmrao
Community Hero

Yes. I happened to notice that. Looks ResponseSLA (your case is subset of it) having problem and it is there from past releases, and not new I believe. Otherwise, not using it rightly.
Are you sure that it did work for you? in which release ?


Regards,
Rao.
mileppaa
Occasional Contributor

Hi,

 

I have version 5.0 (x64 , free, Build Date: 20140409-1012 ) running and JMS Timeout -assertion is working there like I described eg. it uses Request property Timeout. With this version, adding JMS Timeout does not use this dialog that asks for Timeout -value.

But with this 5.2 (Build Date: 20150701-1106), a dialog is does ask for this timeout value and it does not use Request property Timeout. I just tested it and only the value that you give via dialog is valid. Value inserted directly to Request Property Timeout is not used at all.

 

And you were using property expansion, not the number, right?


Regards,
Rao.
mileppaa
Occasional Contributor

Yep,

 

Expansion: ${#Project#Timeout}, we have a property named Timeout at project level. 

 

I also checked the SLA assertion (I have not used that before) and it's a same thing with that. You cannot use expansions with that either (5.0 and 5.2) 😞

 

 

Anyway, I started to check from Soap Ui pages that have I understood something wrong with this testrequest  Timeout -property. I used it before with the JMS Timeout assertion as there were no value asked during Assertion insert. And, in 5.0 it worked like that (I belive that it did :-), it used the timeout value set in testRequest -property.
 Now, the pages  say that "The request Timeout property sets a limit on how long (in milliseconds) the request should wait for a response " I am not sure if that was there before?

Well anyway, I was thinking that now this property Timeout is just separated from JMS Timeout assertion as, of course, you can receive other messages than JMS πŸ™‚ And we need a property to tell soap ui that 'hey, wait only 20 secs for a response, not forever'... So logic is ok with this, now Ijust need to remember that in the future πŸ™‚

But anyway, that does not give answers to the original issue, which is the thing that you can't use expansion to define that timeout value for JMS Timeout -assertion.

mileppaa
Occasional Contributor

Ok, I think I got this solved...

 

I did some searching for this SLA assertion thing and found NMRAO 's script assertion hint:

 

 

assert messageExchange.timeTaken <= (context.expand('${#TestCase#SLA}') as Long), 'SLA failed '

 

So, after changing all of my JMS Timeout Assertions to Script assertions and changed script to use Project Property, I am able to use Project property as a assertion value.

 

Thanx for help!!

 

P.S. Next task is to find out why Soap-UI 5.2 (x64) testrunner gets this java.lang.ClassNotFoundException: com.eviware.soapui.plugins.auto.factories.AutoImportMethodFactory -error...

 

 

cancel
Showing results forΒ 
Search instead forΒ 
Did you mean:Β