cancel
Showing results for 
Search instead for 
Did you mean: 

Groovy and Java scripts in one project

Highlighted
Contributor

Groovy and Java scripts in one project

I have a project need where i need to perform some REST calls in a groovy project but then in the same project need to call some REST API's which has some java script in it for pre setup ....can they both be in the same project as per soap ui documentation we can have only one language in the project properties with the script language set to groovy or Javascript ?

 

So this would be like a nested project where i need both groovy and Javascript to work in the same project 

39 REPLIES 39
Highlighted
Contributor

Yes I am not sure about JS to groovy conversion myself

Can anyone help on this ?
Highlighted
Community Hero

Hey @ameesh1984,

I can have a go at it, but im not a real scripter and i might miss something/be unaware of something that would cause it to fail.

I'll give it a shot, perhaps Rao or Himanshu may be able to help?...theyre definitely better placed to help than i.

In the meantime why dont you have a go too...youve been working with some groovy recently...right?

Between us we might be able to get somewhere.

Thats all i got im afraid,

Nice one

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Highlighted
Contributor

I am on it , pls start with the collection so that you do have a base to begin with

There was no way I could find to have a nested groovy and JS project in soap ui hence we need to convert this to groovy
Highlighted
Community Hero

Np. Working on it right now

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Highlighted
Contributor

Had a q when i try to do this in SOAP UI 

The URL in the collection has 

https://{{DocumentDBHost}}/dbs/rxc-provider-dev-cdb/colls/provider_pharmacy/docs

I created a project level property for DocumentDBHost with value rxc-provider-dev-us-c-cdb.documents.azure.com:443

 

When i use this in my TC like below

https://{#Project#DocumentDBHost}/dbs/rxc-provider-dev-cdb/colls/provider_pharmacy/docs

I get a error 

  • Tue Jun 23 21:54:25 CDT 2020:ERROR:An error occurred [Illegal character in authority at index 8: https://{/#Project%23DocumentDBHost%7D], see error log for details

and Null pointer exception ...

how do i make this work ?

Highlighted
Community Hero

Hey @ameesh1984,

Are you typing out these URLs or are you copy and pasting?

Reason i ask is you state the following:

"https://{{DocumentDBHost}}/dbs/rxc-provider-dev-cdb/colls/provider_pharmacy/docs

I created a project level property for DocumentDBHost with value rxc-provider-dev-us-c-cdb.documents.azure.com:443"

So are you saying the full URL (host and URI) is as follows?

https://rxc-provider-dev-us-c-cdb.documents.azure.com:443/ dbs/rxc-provider-dev-cdb/colls/provider_pharmacy/docs

That hostname is huge.

Anyway (sorry im getting sidetracked) i believe the error response is giving you the clue where it states " error occurred [Illegal character in authority at index 8: https://{/#Project%23DocumentDBHost%7D] "

You have an erroneous forward slash character ( '/' ) in the hostname. The 3rd slash from the left shouldnt be there. A slash is a reserved character in http as it means something specific. Hence you cant use a / in a hostname.

Also you have an extra ] character (which isnt an http reserved character) but the ] character isnt included in the URI you defined earlier in your post.

Nice one

Rich


Is that right?



if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Highlighted
Contributor

The url you have is right that's azure cloud and its long

The issue is I have 5.4 soapui so i cannot import the collection else would not have to do this ...manually create each property

If u have and are trying with 5.5 or Pro etc you could just import collection in soap ui
Highlighted
Community Hero

Yeah i've got ReadyAPI!, but that doesnt help you does it?

I suppose if you send me your collection i could import it and then save it as a new project and send you the project, but i wouldn't have thought the company you work for would allow that...

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Highlighted
Contributor

If you see the collection after import the only parameters are the DocumentHost and master key , you can put your values and change the pre script and make it work, then export it and send me on gmail as they are only json files , that would work

ameesh1984@gmail.com is my gmail
Highlighted
Contributor

You could also put it up on a public github after testing it in your local , same like the original collection and I can take it from there
New Here?
Join us and watch the welcome video:
Top Kudoed Authors