简体   繁体   中英

Remember credentials with serenity BDD (using selenium)

Im trying to create test cases with Serenity BDD (using selenium). I have accepted the fact that between each test case it "restarts" the browser.

And I found a way to not do between Scenarios.

But what Im looking for is to run the test in normal browser mode and not in incognito. I want the browser to click the "remember me" option, log in, log out, and see username and password in the fields. But since the tests are running in the browser with incognito mode, the password is blank.

Any suggestions ?

Thank you

You can configure your driver to run on specific profile of browser. Below is the Mozilla link with steps to configure your profile:

https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data

Once you have configured that profile you can launch that browser manually and save all the user name and passwords manually. So next time when you launch this profile of browser user name and password fields will be auto filled.

*ProfilesIni profile = new ProfilesIni();

FirefoxProfile myprofile = profile.getProfile();

WebDriver driver = new FirefoxDriver(myprofile);*

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM