Newer
Older
ledger / tests / LoginChase.robot
@agalyaramadoss agalyaramadoss on 6 Jan 1 KB initial
*** Settings ***
Library    SeleniumLibrary
Suite Setup    Open Browser To Chase
Suite Teardown    Close All Browsers

*** Variables ***
${URL}    https://www.chase.com
${USERNAME}    ${ENV:CHASE_USER}
${PASSWORD}    ${ENV:CHASE_PASS}

*** Test Cases ***
Login To Chase
    [Documentation]    Log in to Chase using environment variables for credentials.
    Click Sign In
    Input Username
    Input Password
    Submit Login
    Wait For Account Dashboard

*** Keywords ***
Open Browser To Chase
    Open Browser    ${URL}    chrome
    Maximize Browser Window
    Wait Until Page Contains Element    id=signin-button    timeout=10s

Click Sign In
    Click Element    id=signin-button
    Wait Until Element Is Visible    xpath=//input[contains(@id,'user') or contains(@name,'user') or contains(@placeholder,'User')]    timeout=10s

Input Username
    Input Text    xpath=//input[contains(@id,'user') or contains(@name,'user') or contains(@placeholder,'User')]    ${USERNAME}

Input Password
    Input Text    xpath=//input[contains(@id,'pass') or contains(@name,'pass') or contains(@placeholder,'Password')]    ${PASSWORD}

Submit Login
    Click Button    xpath=//button[contains(., 'Sign in') or contains(., 'Sign In')]
    # Adjust the post-login wait condition to a reliable page element for your account
    Wait Until Page Contains    Account overview    timeout=15s

Wait For Account Dashboard
    # Fallback check; update selector/text as needed
    Run Keyword And Ignore Error    Wait Until Page Contains Element    xpath=//h1 | //div[contains(., 'Account') or contains(., 'Overview')]    timeout=15s