Forum Discussion

arttykh's avatar
New Contributor
10 years ago

Facebook website authorization

Hi all,

I need to test "Sign in with Facebook" feature for my website.

How can I do it with SoapUI?


4 Replies

  • HI,

    This can be easy done by using selenium and groovy script:

    Step 1. Download selenium server and place it in <SoapUi Folder>/bin/ext: ... 2.43.1.jar
    Step 2. If you are using an older soapUI version like me (4.6.4) you need to upgrade the http client libs ... , unpack this in to <SoapUI Folder>/Lib
    NOTE: since you have new version of this libs you need to delete the old one that ar found in your lib folder, just look at the version number from file name and delete the old version (small nr)
    Step 3. Start SoapUI if you did the steps correct you should see in the soapUI Log tab : Wed Oct 22 20:18:12 EEST 2014:INFO:Adding [......\SoapUI-4.6.4-m-SNAPSHOT\bin\ext\selenium-server-standalone-2.43.1.jar] to extensions classpath
    Step 4. Create an groovy script that will use selenium to login you on facebook website:

    import org.openqa.selenium.By
    import org.openqa.selenium.WebDriver
    import org.openqa.selenium.WebElement
    import org.openqa.selenium.firefox.FirefoxDriver

    userData = "facebook user "
    passData = "facebook password"

    WebDriver driver = new FirefoxDriver()

    //Input the user credentials and authorize the application;

    if (driver.findElements("email")).size() == 1 ){

    //you should be logged on the facebook page and do stuf here :)

    } else "Fail to load the facebook page"


  • arttykh's avatar
    New Contributor
    Hi ccdssv1,
    thank for your reply.

    I have managed to do it using get/post requests.

    First I've send GET facebook login page:


    Then I've parsed facebook login form with Property Transfer step to get required values for inputs.

    e.g: //*:input[@name="lsd"]/@value

    In the last step I've send POST request with all required params:



    After this I was signed in on my test web site.
  • Hello mate,


    Could you give me help on that last thing you did? I'm not being able to reach the logic on how to parse the login form.



  • JHunt's avatar
    Community Hero

    In this case they were using Facebook, and they had to get a form value from the Facebook login page to include on the login request submission. That's not going to be needed for most other sites (there are lots of different ways that websites handle logging in).


    Based on your other topic, I don't think you're using Facebook, so let's stick to that other topic and try to work out together what you need to do for your particular site or service.