1

Need to virtualize google OAuth2 for testing a web app that uses OAuth for user sign in, Any ideas ?

Currently using Java/TestNG/Selenium, I tried with Hoverfly but I am still analyzing request/response pairs to figure out how to make simulation succeed.

(I have a web application under test (black box) where I need to automate tests of some activities made by a google-signed-in user, so first step is to login with google account, I currently do this with (selenium) actual google account but sometimes script gets blocked with google verification.)

This issue could have been solved long time ago simply if google adds [disable login challenges] option in account settings but I don't think they are doing that any time soon.

Update 2018-09-01

solved without mocking https://stackoverflow.com/a/52126066/1356559

Amr Lotfy
  • 2,937
  • 5
  • 36
  • 56
  • If I understand you well, you would like to test your Oauth2 client in your application against google Oauth2 server. Have you checked [Google OAuth playground](https://stackoverflow.com/questions/25657190/how-to-get-dummy-google-access-token-to-test-oauth-google-api)? – m4gic Aug 22 '18 at 08:07
  • @m4gic I updated the question. – Amr Lotfy Aug 22 '18 at 23:22
  • 1
    Maybe [this](http://engineering.pivotal.io/post/faking_oauth_sso/) helps. – m4gic Aug 23 '18 at 12:32
  • @m4gic Thank you very much, I will try it :) – Amr Lotfy Aug 23 '18 at 23:55
  • @m4gic I see that link above was for white box testing, my case is different, I don't have app source code, I will keep trying with hoverfly, I don't know if google OAuth2 is even mock-able or not. – Amr Lotfy Aug 25 '18 at 05:23

0 Answers0