Google Authenticator Support for Gmail 2FA

Through Gmail 2FA support, testRigor users can use 2FA authentication within test cases. This article details how to configure the Gmail account and test suite in testRigor application.
Requirements

In order to generate a Google Authenticator code inside your test cases, you must:

  1. Have a Gmail account.
  2. Have a testRigor account, if you still don’t have one you can get yours now.
  3. Complete the steps below to set everything up.
Configuration Steps

To use this feature you basically need to setup the Gmail account to execute the 2FA authentication using Google Authenticator as code provider, save the QRcode used on this setup and upload it to your test suite. The steps below show in details how to do this:

Step One – Configure Gmail 2FA
  1. Login to your Gmail account.
  2. Click on “Manage your google account”.
  3. Click on “Security”.
  4. Click on “2-step verification”.
  5. Click on “Get started”.
  6. Enter your password again, if requested.
  7. Select a phone number to receive the confirmation code.
  8. Enter the code received in your phone.
  9. Click on “Turn on”. At this point, you enabled the 2 step verification for your Gmail account. Now we’ll procced to select the way to generate the code for 2FA.
  10. Select “Autheticator App” in the list.
  11. Click on “Set up autheticator”.
  12. A dialog with a QRcode will be displayed. You will need this QRcode to generate the code inside testRigor test cases. That way, capture the QRcode and save it to a file.
  13. After save the QRcode you must finalize the setup of authenticator with your cell phone. Download the “Authenticator app” in your cell phone and scan the QRcode.
  14. Click “Next” and enter the code generated in your cell phone app to finish the setup.
  15. At this point, you finished the setup of 2-step verification and with the QRcode image saved in step 12 you will able to execute this type of authentication inside testRigor test cases.
Step Two- testRigor Setup
  1. Login to your testRigor account.
  2. Create or access the suite you want to test the authentication.
  3. Click on “Test Data”.
  4. Click on “Add”.
  5. In type field select “File”, enter a name to reference the variable in test cases and upload the QRcode image.
  6. Now you are able to use the custom command to generate a code inside your test case. There are some examples of the command:
    generate pin with google authenticator from stored value "qr-code" and save as "out-variable"
    generate code with google authenticator from stored value "qr-code" and save as "out-variable"
    generate google authenticator code from stored value "qr-code" and save as "out-variable"
    generate google authenticator pin from stored value "qr-code" and save as "out-variable"
    generate google code from stored value "qr-code" and save as "out-variable"
    generate google pin from stored value "qr-code" and save as "out-variable"
  7. There’s a test case with simple Gmail login example: test case example
Video Reference

You can check all the steps in the video below: