diff --git a/README.md b/README.md new file mode 100644 index 0000000..7ef943b --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +Robot Framework test to (example) log in to Chase + +Setup + +1. Create and activate a Python virtualenv (recommended): + +```bash +python3 -m venv .venv +source .venv/bin/activate +``` + +2. Install dependencies: + +```bash +python -m pip install -r requirements.txt +``` + +3. Export your credentials as environment variables (do NOT hard-code them): + +```bash +export CHASE_USER="your_username" +export CHASE_PASS="your_password" +``` + +Run the test + +```bash +robot tests/LoginChase.robot +``` + +Notes and security + +- The locators in `tests/LoginChase.robot` are placeholders and may need updating to match the live Chase site; use your browser inspector to get reliable ids/xpaths. +- Prefer using secure credential storage rather than raw environment variables for CI; consider using your CI secret manager or an encrypted variable file. +- Running this test requires a graphical browser (Chrome) and a matching WebDriver (Chromedriver). You can use `webdriver-manager` or install Chromedriver manually. +- Only run automated login against accounts you own and with explicit permission. + +If you want, I can try to help update the locators for the current Chase login flow or show how to run this headlessly. \ No newline at end of file diff --git a/log.html b/log.html new file mode 100644 index 0000000..0b331ee --- /dev/null +++ b/log.html @@ -0,0 +1,2467 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Opening Robot Framework log failed

+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/output.xml b/output.xml new file mode 100644 index 0000000..3b715ad --- /dev/null +++ b/output.xml @@ -0,0 +1,161 @@ + + + + + +Opening browser 'chrome' to base url 'https://www.chase.com'. +${URL} +chrome +Opens a new browser instance to the optional ``url``. + + + +Maximizes current browser window. + + + +xpath=//a[contains(., 'Sign in')] +timeout=10s +Waits until the element ``locator`` appears on the current page. + + + + + + + +Clicking element 'xpath=//a[contains(., 'Sign in')]'. +</td></tr><tr><td colspan="3"><a href="selenium-screenshot-1.png"><img src="selenium-screenshot-1.png" width="800px"></a> +ElementNotInteractableException: Message: element not interactable + (Session info: chrome=143.0.7499.170); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#elementnotinteractableexception +Stacktrace: +0 chromedriver 0x000000010086cb2c cxxbridge1$str$ptr + 3033596 +1 chromedriver 0x0000000100864b30 cxxbridge1$str$ptr + 3000832 +2 chromedriver 0x000000010035e970 _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 73784 +3 chromedriver 0x00000001003a69e0 _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 368808 +4 chromedriver 0x000000010039bca4 _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 324460 +5 chromedriver 0x000000010039b748 _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 323088 +6 chromedriver 0x00000001003e6968 _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 630832 +7 chromedriver 0x000000010039a16c _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 317492 +8 chromedriver 0x0000000100830098 cxxbridge1$str$ptr + 2785128 +9 chromedriver 0x0000000100833804 cxxbridge1$str$ptr + 2799316 +10 chromedriver 0x0000000100810850 cxxbridge1$str$ptr + 2656032 +11 chromedriver 0x0000000100834074 cxxbridge1$str$ptr + 2801476 +12 chromedriver 0x00000001008011cc cxxbridge1$str$ptr + 2592924 +13 chromedriver 0x0000000100853cb4 cxxbridge1$str$ptr + 2931588 +14 chromedriver 0x0000000100853e34 cxxbridge1$str$ptr + 2931972 +15 chromedriver 0x0000000100864788 cxxbridge1$str$ptr + 2999896 +16 libsystem_pthread.dylib 0x0000000197856f94 _pthread_start + 136 +17 libsystem_pthread.dylib 0x0000000197851d34 thread_start + 8 + +xpath=//a[contains(., 'Sign in')] +Click the element identified by ``locator``. +ElementNotInteractableException: Message: element not interactable + (Session info: chrome=143.0.7499.170); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#elementnotinteractableexception +Stacktrace: +0 chromedriver 0x000000010086cb2c cxxbridge1$str$ptr + 3033596 +1 chromedriver 0x0000000100864b30 cxxbridge1$str$ptr + 3000832 +2 chromedriver 0x000000010035e970 _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 73784 +3 chromedriver 0x00000001003a69e0 _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 368808 +4 chromedriver 0x000000010039bca4 _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 324460 +5 chromedriver 0x000000010039b748 _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 323088 +6 chromedriver 0x00000001003e6968 _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 630832 +7 chromedriver 0x000000010039a16c _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 317492 +8 chromedriver 0x0000000100830098 cxxbridge1$str$ptr + 2785128 +9 chromedriver 0x0000000100833804 cxxbridge1$str$ptr + 2799316 +10 chromedriver 0x0000000100810850 cxxbridge1$str$ptr + 2656032 +11 chromedriver 0x0000000100834074 cxxbridge1$str$ptr + 2801476 +12 chromedriver 0x00000001008011cc cxxbridge1$str$ptr + 2592924 +13 chromedriver 0x0000000100853cb4 cxxbridge1$str$ptr + 2931588 +14 chromedriver 0x0000000100853e34 cxxbridge1$str$ptr + 2931972 +15 chromedriver 0x0000000100864788 cxxbridge1$str$ptr + 2999896 +16 libsystem_pthread.dylib 0x0000000197856f94 _pthread_start + 136 +17 libsystem_pthread.dylib 0x0000000197851d34 thread_start + 8 + + + +xpath=//input[contains(@id,'user') or contains(@name,'user') or contains(@placeholder,'User')] +timeout=10s +Waits until the element ``locator`` is visible. + + +ElementNotInteractableException: Message: element not interactable + (Session info: chrome=143.0.7499.170); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#elementnotinteractableexception +Stacktrace: +0 chromedriver 0x000000010086cb2c cxxbridge1$str$ptr + 3033596 +1 chromedriver 0x0000000100864b30 cxxbridge1$str$ptr + 3000832 +2 chromedriver 0x000000010035e970 _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 73784 +3 chromedriver 0x00000001003a69e0 _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 368808 +4 chromedriver 0x000000010039bca4 _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 324460 +5 chromedriver 0x000000010039b748 _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 323088 +6 chromedriver 0x00000001003e6968 _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 630832 +7 chromedriver 0x000000010039a16c _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 317492 +8 chromedriver 0x0000000100830098 cxxbridge1$str$ptr + 2785128 +9 chromedriver 0x0000000100833804 cxxbridge1$str$ptr + 2799316 +10 chromedriver 0x0000000100810850 cxxbridge1$str$ptr + 2656032 +11 chromedriver 0x0000000100834074 cxxbridge1$str$ptr + 2801476 +12 chromedriver 0x00000001008011cc cxxbridge1$str$ptr + 2592924 +13 chromedriver 0x0000000100853cb4 cxxbridge1$str$ptr + 2931588 +14 chromedriver 0x0000000100853e34 cxxbridge1$str$ptr + 2931972 +15 chromedriver 0x0000000100864788 cxxbridge1$str$ptr + 2999896 +16 libsystem_pthread.dylib 0x0000000197856f94 _pthread_start + 136 +17 libsystem_pthread.dylib 0x0000000197851d34 thread_start + 8 + + + + + + + + + + + + + + +Log in to Chase using environment variables for credentials. +ElementNotInteractableException: Message: element not interactable + (Session info: chrome=143.0.7499.170); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#elementnotinteractableexception +Stacktrace: +0 chromedriver 0x000000010086cb2c cxxbridge1$str$ptr + 3033596 +1 chromedriver 0x0000000100864b30 cxxbridge1$str$ptr + 3000832 +2 chromedriver 0x000000010035e970 _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 73784 +3 chromedriver 0x00000001003a69e0 _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 368808 +4 chromedriver 0x000000010039bca4 _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 324460 +5 chromedriver 0x000000010039b748 _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 323088 +6 chromedriver 0x00000001003e6968 _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 630832 +7 chromedriver 0x000000010039a16c _RNvCsgXDX2mvAJAg_7___rustc35___rust_no_alloc_shim_is_unstable_v2 + 317492 +8 chromedriver 0x0000000100830098 cxxbridge1$str$ptr + 2785128 +9 chromedriver 0x0000000100833804 cxxbridge1$str$ptr + 2799316 +10 chromedriver 0x0000000100810850 cxxbridge1$str$ptr + 2656032 +11 chromedriver 0x0000000100834074 cxxbridge1$str$ptr + 2801476 +12 chromedriver 0x00000001008011cc cxxbridge1$str$ptr + 2592924 +13 chromedriver 0x0000000100853cb4 cxxbridge1$str$ptr + 2931588 +14 chromedriver 0x0000000100853e34 cxxbridge1$str$ptr + 2931972 +15 chromedriver 0x0000000100864788 cxxbridge1$str$ptr + 2999896 +16 libsystem_pthread.dylib 0x0000000197856f94 _pthread_start + 136 +17 libsystem_pthread.dylib 0x0000000197851d34 thread_start + 8 + + + +Closes all open browsers and resets the browser cache. + + + + + + +All Tests + + + + +LoginChase + + + +Error in file '/Users/agalyaramadoss/repo/ledger/tests/LoginChase.robot' on line 9: Setting variable '${PASSWORD}' failed: Resolving variable '${ENV:CHASE_PASS}' failed: Variable '${ENV}' not found. +Error in file '/Users/agalyaramadoss/repo/ledger/tests/LoginChase.robot' on line 8: Setting variable '${USERNAME}' failed: Resolving variable '${ENV:CHASE_USER}' failed: Variable '${ENV}' not found. + + diff --git a/report.html b/report.html new file mode 100644 index 0000000..75e9a2e --- /dev/null +++ b/report.html @@ -0,0 +1,2729 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Opening Robot Framework report failed

+ +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a24a551 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +robotframework +robotframework-seleniumlibrary +selenium +webdriver-manager diff --git a/selenium-screenshot-1.png b/selenium-screenshot-1.png new file mode 100644 index 0000000..3702dbe --- /dev/null +++ b/selenium-screenshot-1.png Binary files differ diff --git a/tests/LoginChase.robot b/tests/LoginChase.robot new file mode 100644 index 0000000..68ecc07 --- /dev/null +++ b/tests/LoginChase.robot @@ -0,0 +1,43 @@ +*** 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