Forum Discussion

AutUser's avatar
AutUser
Occasional Contributor
16 years ago

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

  • AutUser's avatar
    AutUser
    Occasional Contributor
    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
    • jvich's avatar
      jvich
      Occasional Contributor

      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

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    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
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    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
  • AutUser's avatar
    AutUser
    Occasional Contributor
    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://user:pwd@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
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    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
    • NidhiGarg's avatar
      NidhiGarg
      Occasional Contributor

      Hi Team,

       

      I have an issue , i need to launch a browser, unable to mimic it via HTTP request.

      Issue is I am unable to do the same via microsoft azure. where once i enter the URL it asks me the username and password and on the URL itself it returns the token that is used for authentication of other API's.

      Refer this: https://github.com/AzureAD/azure-activedirectory-library-for-js

       

  • AutUser's avatar
    AutUser
    Occasional Contributor
    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://user:pwd@domain.mycompany.com:8085/v1/years/");

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

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

    Thanks in advance,
    Igor
  • AutUser's avatar
    AutUser
    Occasional Contributor
    Hi,

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

    Thanks
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Igor,


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


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