cancel
Showing results for 
Search instead for 
Did you mean: 

Launch browser with specific URL and return text back into Soap UI

Highlighted
Occasional Contributor

Launch browser with specific URL and return text back into Soap UI

Hello,

Would anyone please give me a hint on how to do this?

Launch a browser with an specific URL and return the text back into Soap UI for
analisys.

Thanks a lot in advance
Igor

10 REPLIES 10

Re: Launch browser with specific URL and return text back into Soap UI

Hi Igor,


You may be able to achieve this by using an HTTP client (not necessarily a web browser) that can save a URL destination as a file (wget or curl). You could then create a Groovy script that invokes such an HTTP client and process the file (found at a known location on the local file system) in subsequent test steps.

Do let us know if you managed to do this.


Cheers!
/Nenad Nikolic a.k.a. Shonzilla


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.

Re: Launch browser with specific URL and return text back into Soap UI

Hi,

Why not just use a HttpTestRequest from within soapUI? You should be able to mimic the browsers request fully by doing so.

Regards,
Dain
eviware support


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.
Occasional Contributor

Re: Launch browser with specific URL and return text back into Soap UI

Hi Dain,
I knew it was supposed to work with HTTPTestRequest but could not make it work and found no real examples of that. If you can provide me with a brief, real example, I'd appreciate it.

In the mean time, I used Groovy to solve my problem using logic including:

url = new URL("http://www.mywebsite.com")
def output = url.getText()

Best regards,
Igor
Occasional Contributor

Re: Launch browser with specific URL and return text back into Soap UI

Hello,

When using the url command in groovy to get the content of a web page
for which a username and password is required,
noticed that I need to pass credentials somehow in here
url = new URL("http://userSmiley Tonguewd@server.domain.com:3000/v1/carids/38155/components/1/")

I have the same problem with HTTPTestRequest,
If anyone can provide me with a hint on how to solve this problem, I'd really appreciate it

thanks in advance

Re: Launch browser with specific URL and return text back into Soap UI

Hi Igor,


What kind of problem do you have? Being more specific will make it easier for someone to help you.

The solution really depends on what type of authentication is used by the server you're accessing. Could you figure out what is it?


Cheers!
/Nenad Nikolic a.k.a. Shonzilla


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.
Occasional Contributor

Re: Launch browser with specific URL and return text back into Soap UI

Hello,

Thanks for asking.

When I browse thru the Rest Server (looks like a Web page actually),
I'm been asked to authenticate myself,and a popup screen displays asking for
the corresponding username and password.

After that, I get immediate access to the web pages and can navigate thru them.

When I try the same from SoapUI using Groovy, I get the following:

Exception thrown: Server returned HTTP response code: 401 for URL: http://domain.mycompany.com:8085/v1/years/

java.io.IOException: Server returned HTTP response code: 401 for URL: http://domain.mycompany.com:8085/v1/years/

Don't know if this info is enough to get my self understood.

If I put my username and passord on the URL command as follows:
URL url = new URL("http://userSmiley Tonguewd@domain.mycompany.com:8085/v1/years/");

I get exactly the same error message:
Exception thrown: Server returned HTTP response code: 401 for URL: http://userSmiley Tonguewd@domain.mycompany.com:8085/v1/years/

java.io.IOException: Server returned HTTP response code: 401 for URL: http://userSmiley Tonguewd@domain.mycompany.com:8085/v1/years/

Thanks in advance,
Igor
Occasional Contributor

Re: Launch browser with specific URL and return text back into Soap UI

Hi,

Finally did it with HTTPTestRequest, provided with the autorization credentials. How easily done on SoapUI

Thanks

Re: Launch browser with specific URL and return text back into Soap UI

Hi Igor,


I'm glad you managed to successfully access the authentication-protected HTTP server.


Cheers!
/Nenad Nikolic a.k.a. Shonzilla


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.
Occasional Contributor

Re: Launch browser with specific URL and return text back into Soap UI

Hi all. The http request didn't work for me due javascript redirects.

 

Page 1 loads and redirect to page 2 with post paramenters

then page 2 redirects to page 3 and so on

following the payment gateway

 

I follow the groovy script and works fine (by hand and hard work).

 

Thanks a lot

New Here?
Join us and watch the welcome video:
Top Kudoed Authors