Search code examples
c#.netwatinlinkedin-api

WatiN does not works with LinkedIn OAuth token Access Form


Does WatiN support redirects?

I'm trying to automate testing linked in integration library with WatiN.

// url like "https://api.linkedin.com/uas/oauth/authorize?oauth_token=ba826cd4-644a-4709-b2de-bedb7c8fb5b4"
 using (var ie = new IE(authorizationUrl)) 
 {
    if (ie.TextField("email-oauthAuthorizeForm").Exists 
           && ie.TextField("password-oauthAuthorizeForm").Exists)
    {
         ie.TextField("email-oauthAuthorizeForm").Value = "[email protected]";
         ie.TextField("password-oauthAuthorizeForm").Value = "password";
         ie.Button(Find.ByName("authorize")).Click();
         //ie.Forms[0].Submit();
    }
}

The button are pressed, and Internet Explorer redirects immediately to the same page. Form submit have the same behaviour.

What you think about it? Is that WatiN problem or linkedin guard?


Solution

  • Note that LinkedIn's Terms of Service do not allow you to script the authorization flow. We require you to let the user decide to grant or deny access to your integration via the form provided.

    If it's automated test suites you're after I'd suggest authorizing an access token once and storing that with your test scripts.