Execute tests with the same browser type concurrently which use the same cookies? - selenium

Execute tests with the same browser type concurrently which use the same cookies?
Scenario: Run multiple tests (x3) as the same time which all use firefox.
Currently if a item gets added to the basket it causes the tests to fail because all instances of the browser are using the same cookies.
Is it possible to use the same browser more than once at the same time even if web cookies are involved?
Maybe require the use of browser profiles?
Thanks for your help

I'm not sure, but first idea is to use different user (who is logged in to firefox) for each test. I think they should have different cookies.

Related

Can I open cypress test in a desired browser session?

I am new to cypress and I am trying to automate few things; rather than testing. Actually I am trying to make a simple comment bot in a desired website. My problem is that whenever I try to Login with cypress, it wants me to solve recaptcha. I know recaptcha is only meant for human to solve and so I am thinking, I would first login manually myself then run the cypress in that logged in browser session to automate few things; like commenting for example. This one also doesn't seem to possible with the cypress because they mention they clear all the browser session and storage while starting the test. So is there any workaround to it? Or any alternatives?

Login through Google SSO using automated browser

I am trying to automate login to my app which uses among others, google sso authentication.
However login form return error "This browser or app may not be secure.". I set my google account options to allow less secure apps but still nothing.
I browsed few topics:
GMail is blocking login via Automation (Selenium)
Selenium Google Login Block
Automation Google login with python and selenium shows ""This browser or app may be not secure""
And it seems that google is blocking this way at all in favor of oauth.
People write in these topics that solutions stopped working recently
So is it currently possible, to set ChromeDriver somehow using capabalities, to be able to login through SSO?. I need a simple solution, that will run headless with other scripts on cloud (not something that would require me to manually login first on another instance as one anwser suggests).
If its not possible or extremly complicated please tell me I will not waste time on it.
If you want to use chrome capabilities, what you can do is set the user-data-dir to a chrome profile that has already been signed in using SSO.
You should look up how to reuse chrome profiles with selenium.
If your accounts have 2 steps verifications, google believe it's safer and allows you to get login. Then the issue will be how to handle the 2 steps verifications. Working on that :/

Selenium Webdriver Login activity on Amazon.com: “Verification needed”

I am trying to run some automated tests on amazon.com by using Selenium Webdriver. I tried to log in to the system but after entering the password, system either directs to “Verification needed” page and says “We will email you a code to verify your identity. This is required when something about your sign-in activity changes, like signing in from a new device or location.”
or directs to “wrong password or email” page (eventhough I try correct account information).
So my question is: How can I handle that two factor authentication in my test script?
Note: I am using ChromeDriver and Java
there are two possible approaches:
first one, you can as Kiril S mentioned, get the link from email (mailinator.com is fine inbox for such testing).
second approach is avoiding the second verification with existing browser profile. Selenium uses a temporary profile, that's probably the reason of the second verification. I'm using existing browser profile (firefox), see Selenium Chromedriver - Open Chrome Normally. For Chrome should be similar.

robot framework test user role single sign-on

I'm trying to use robot framework as a ui test tooling for a website we use internal.
To test different user roles I open the browser with basic authentication (http://user:ww#url). Unfortunately this methode is removed from chrome and chromedriver (http://www.chromestatus.com/feature/5669008342777856) (for the test I use PhantomJS).
because of this issue subresource requests are blocked. See image attached.
Because of this issue also js files are blocked and therefore my UI tests don't work properly.
Does anybody have an idee on how to solve this or another way of testing?
This issue is being encountered by all browser automation frameworks. This SO answer describes an approach to take a two step approach:
Go to the url with http://user:pass#hostname.ext
Go to the url with http://hostname.ext
The username and password are cached and subsequent visits will reuse it.

How to test logging in with openid using Selenium

Is there a way to test logging into a site with open id using Selenium?
In Selenium all the tests live in the server, so once filled the open id URL in the appropriate field in the web page I am taken to the 3rd party web page for entering the credentials and my test can't run anymore.
Is there a way around this?
Yes - use Selenium RC. It gets around the cross-domain problem of basic Selenium Core and allows you to script against multiple sites.
I guess, technically speaking, you could include a really dumb OpenID server on your testing domain, but Patrick's suggestion of a testing framework that supports cross-domain operations sounds like a much better idea.
Although, I guess that depends on what you're trying to test. It could be that using a third party OpenID server is bad for your tests, because a change to the UI of that server could cause your tests to break. Or maybe you want to make sure that your code is interoperating correctly with that server, in which case using the 3rd party is exactly what you want to test.