SeleniumHQ / selenium-ide

Open Source record and playback test automation for the web.
https://selenium.dev/selenium-ide/
Apache License 2.0
2.84k stars 768 forks source link

Session-Based or Persistent-LocalStorage Browser Automation #1796

Open dendihandian opened 9 months ago

dendihandian commented 9 months ago

I know that for testing purpose, sessionless is preferred. But I use Selenium IDE for data engineering and ingestion purpose, Selenium IDE is a great tools. My problem using this tools is when I face complicated Authentication method like OTP and I can't automate it. So, does Selenium IDE provide session-based test case or is there any alternative? if your solution is Desktop-Automation like PyAutoGUI, just forget it. It's a nightmare for this case.

Note: I have tried Persist Session and it's not working, the OTP confirmation still occured.

toddtarsi commented 9 months ago

@dendihandian - You tried on v3 or v4? If happened on v3, I can't do much. If happened on v4, I have these questions:

What level of session persistence are you looking for. If you close and re-open IDE, are you expecting session to still persist? Generally, persist session was only designed for suite level playback. If you play a suite, the browser state in test 1 (cookies, localstorage, etc) is still there in test 2. Ultimately, this comes down to a concept called "realms" in javascript, and where I persist / reuse the current "realm". If you can help clear up my understanding of what level / form of persistence matches your use case, I'd be happy to look into providing a system level settings switch around this.

dendihandian commented 8 months ago

@toddtarsi

I'm automating appstore connect, when you log-in a fresh browser it will perform OTP verification. After you logged-out and log-in back, it will not asking OTP for week/month.

I think it has something todo with either localstorage or maybe cookies. But why fully-scripted existing installed browser automation isn't exists anywhere....

toddtarsi commented 8 months ago

@dendihandian - Thanks for explaining! Yes, I aggressively eat localstorage and cookies because historically, this tool has been for running tests, and you want a clean baseline for tests. I'll look at improving the system settings here so that they work x-project a bit better, and then I'll add a "automation helper" mode (does not reset data in any way at any point).