Skip to main content

authentication Scenario 5 — OAuth Google Sign-In Flow

Written by RTILA X Engineering Team

Intermediate ~6 min
Prerequisites: basic-navigation/1 forms/1

What You'll Learn

Simulate OAuth sign-in flows

Real-World Use Case

Interacting with sites that use Google or Facebook login

LIVE DEMO

OAuth Simulation

A fake Google popup that accepts a demo credential set and returns an OAuth success state.

EXPECTED OUTPUT

OAuth Success Profile

label value
Email user@gmail.com
Name Test User
Provider Google
RTILA X PROJECT JSON

RTILA X Automation Project

oauth-google-signin.json
    {
  "name": "OAuth_Google_SignIn_Flow",
  "settings": {
    "urls": [
      "https://learn.rtila.com/scenarios/authentication/5"
    ]
  },
  "datasets": {
    "oauth_user": {
      "item_selector": "css=.oauth-success table tr",
      "properties": [
        {
          "name": "label",
          "type": "text",
          "selector": "css=td:first-child"
        },
        {
          "name": "value",
          "type": "text",
          "selector": "css=td:last-child"
        }
      ]
    }
  },
  "commands": [
    {
      "command": "goto",
      "params": {
        "url": "https://learn.rtila.com/scenarios/authentication/5"
      }
    },
    {
      "command": "wait_for_selector",
      "params": {
        "selector": "css=#google-signin-btn"
      }
    },
    {
      "command": "click",
      "params": {
        "selector": "css=#google-signin-btn"
      }
    },
    {
      "command": "wait_for_selector",
      "params": {
        "selector": "css=#google-popup"
      }
    },
    {
      "command": "fill",
      "params": {
        "selector": "css=#google-email",
        "value": "user@gmail.com"
      }
    },
    {
      "command": "fill",
      "params": {
        "selector": "css=#google-password",
        "value": "googlepass"
      }
    },
    {
      "command": "click",
      "params": {
        "selector": "css=#google-submit"
      }
    },
    {
      "command": "wait_for_selector",
      "params": {
        "selector": "css=.oauth-success"
      }
    },
    {
      "command": "extract_data",
      "params": {
        "dataset": "oauth_user"
      }
    }
  ]
}
  

RTILA X Concepts

OAuth popups are handled like any other modal. Wait for the popup selector, fill the provider form, and click submit. Then wait for the post-OAuth success state before extracting the returned profile.

Did you complete this scenario?

Ready to run this automation?

Copy the project JSON above, open RTILA X, create a new project, and paste it.

This scenario covers 3 RTILA X commands and is referenced in 2 learning articles.

Continue Learning

Was this helpful?