I would like to automate the following use-case using selenium grid (nightwatch) / browserstack,
Login using 1st user
Login with 2nd user in incognito window or different browser
2nd user is a manager to 1st and interacts with user 1
Automate flows to test if 1st & 2nd user interactions works as expected
Is it possible to automate this flow? Parallel testing cannot be possible as the above use-case happens synchronously
I would like to let you know that your use case would be possible if the same is possible by you locally at your end on a local Selenium grid at your end.
Note:- You cannot open 2nd browser in the same session however you can open another tab window and also can open a session in incognito. Should you be able to open a normal browser and an incognito window in the same session locally, then you would be able to test your use case on Browserstack as well.
Related
We are using Snowflake with Active Directory authentication. When we add the registry entry of authenticator: externalbrowser for ODBC to work, every query/fetch leads to a new browser tab window to be opened for SAML token. So if the Excel sheet we are working with has 10 queries, 10 new chrome tab windows open up.
The same applies when we run Python scripts. We add authenticator='externalbrowser' to the connect command and then each and every query in the script leads to the opening of a new browser tab to get the SAML token. This of course is quite annoying since we end up with 100's of browser window
tabs being opened.
Thanks.
This is by design since you are specifying the authentication method as 'externalbrowser', however it only opens a new browser for each connection that is made. Check to see if each of your queries establishes a new connection object.
What you want is to open a connection object once, then use a cursor object from the connection each time you need to execute a query.
I have a feature file with few scenarios:
in every scenario I need to login in app and then do checks
But if first scenario failed on step after login, it does not perform logout
and then second scenario is failed.
How to bring app to first state? (start app, and not logged in)
driver.resetApp() does not work for me
If driver.resetApp() does not work for you, you can try to write this into the desired capabilities instead.
Try adding the fullReset capability to your driver options -- this is based on this GitHub discussion from Appium:
options.AddAdditionalCapability("fullReset", "true");
If you do not wish to reset the app, but actually just close & restart it, you can use:
driver.closeApp();
driver.launchApp();
Say I am using baseurl of http://www.newtours.demoaut.com/ to login. So after login test (successful login) the base url is changed to http://newtours.demoaut.com/mercuryreservation.php?osCsid=929093474fd911e10f3a61562f069efd with a token. So this page test will be a different test but it should come from previous login. Creating two different test cases and running them as a suite is failing as the token is different each time. How to handle this??
SwitchTo().window()
in tabs index starts with 0
I am testing a platform using testcafe for end to end tests. I have a case for testing login but I have other cases that require login.
I am not sure what is the best option I should run login on every test case setup or should run first a script login and then run all tests? I have tried both and they seem good options.
Having to log in for each and every test is time-consuming and inefficient. I would recommend having a single login for the tests if;
There is no dependency between the logged in user and the test that is running.
The actual result you are looking for can be achieved by just a single login
Furthermore, I would use 2-3 users for tests just to be cover multiple users login into the system.
TestCafe has powerful mechanism of Roles for testing login/logout functionality.
You can create Role for each user account which you would like to test and switch between them in tests. To switch to an unregistered user, you can use Role.anonymous().
The main profit of using Roles is that logging steps are executed only one time during first using of Role and next time TestCafe just reloads the page and restores required credentials.
It depends what you are testing:
If you are testing the authentication then they should login each time.
If you are testing something else then I would place this in the Arrange part of the code following the Arrange Act Assert pattern as it's not relevant to the other tests and as part of the test setup (Arrange) it should navigate back to the home page.
Ideally you isolate the authentication from other tests for performance, however if your session has some state that it has carried over from the last test you should clean this up so other tests are not effected by it.
A comment in the Git issue suggests that you can use preserveUrl to keep your session.
We are using SHDocVw.InternetExplorer in VB.Net to navigate to a web page and insert the login credentials since we have to log into multiple accounts throughout the day.
We want to be able to be logged into to multiple accounts in different windows at the same time, but I don't know how to get a new session started.
If I log into account A, and then try to log into account B, it opens a new window but is automatically account A, since the browser remembers being logged in with that session.
Is there a newSession or something similar that I can call that will get around this problem?
Edit: is this something can can be done using the Navigate function by setting a header?
SHDovVw and the WebBrowser control are all basically embedded versions of IE. If you log into your site using the control and then visit the site in IE you'll see that you're logged in there, too. There's no way to force one control/instance/tab to use a separate cookie system which is basically what you're trying to do. The only way to control sessions is through QueryStrings which could be made unique to each browser.