How to persist session in testim platform for all test cases? - testim.io

Is there a way to persist session across test cases while writing automation in testim.io?
For example, I have a screen where a logo comes up, and a search bar comes below it. This page can only be accessed after login. I am considering only 2 test cases for the scope of this question.
the logo of the page is coming up properly
the search bar is coming up properly
Now I begin writing automation in testim. Browser opens us, takes the saved credentials and logs in, after that I verify if the logo is coming up. I record everything.
I am done with this test case and move on to the next one. For next, I don't want to go to the login screen again. I just want to be logged in and start from where I left off and hit recording in the same browser.

Related

Robot Framework too fast for New Window

I'm exploring Robot Framework for some smoke testing of a site, and at a point have to sign in, which opens a new window. Moving to the new window with Select Window works for me, but I'm bridging this change by identifying the title of Sign In, and the new window does not immediately adopt that title as it loads your login form - sometimes this takes half a second, sometimes more than 5.
I'm working around this right now by having the test sleep for the obnoxiously long period of 10s, but surely there are more reliable ways of ensuring that I can change my target window to the new one, and not have my test fail and exit while the page is loading. I took a shot at using the redirect url as the identifier, but sometimes it redirects very quickly and fails, or if not, then it gets hung up on the next check for the login field that isn't loaded. I've seen commands like Wait Until Element Is Visible, but unfortunately that doesn't help when I can't target the window where things are loading...
For the sake of it:
*** Test Cases ***
Basic Workflow
Open Browser To Homepage
Go To Sign In
*** Keywords ***
Open Browser To Homepage
Open Browser ${HOMEPAGE} ${BROWSER}
Maximize Browser Window
Set Selenium Speed ${DELAY}
Go To Sign In
Click Button Sign In
Sleep 10s
Select Window Sign In
Title Should Be Sign In
Using Selenium2Library currently.
lauda had it right in writing out a Keyword for managing the Select Window. I found Wait Until Keyword Succeeds and made a keyword for it to wait on.
Go To Sign In
Click Button Sign In
Wait Until Keyword Succeeds 20s 3s Switch To Sign In Page
Title Should Be Sign In
Switch to Sign In Page
Select Window Sign In
Thank you, both!

Funcunit - why does the speed and reliability of my tests differ depending on whether the test is being run in the active tab in Chrome?

I'm trying out FuncUnit with a simple login/logout script for an app, using Chrome on Windows 7. I've noticed that both the speed and reliability of the test differ depending on if the test is running in the currently selected tab in Chrome.
If the tab isn't selected, the test runs quickly and without error. If the tab is selected, text is typed slowly and sometimes incompletely (so only half the password will be typed before the submit button is clicked), clearly visible elements fail to be found and the test has about a 50% success rate.
Am I missing something here? It's proving less reliable than even QTP unless I deliberately deselect the loaded tab and I'm dubious about any automated test that needs user interaction to pass reliably.
Turned out to be a Chrome version specific issue

Where does mobilefirst-qa store the selected user?

After choosing the user in the login view, the library saves this information somewhere so that the app has not to ask for the user again.
Where is this information stored? I need to know how to reset this setting for a fresh start?
If you're simply looking to switch between users, there is an easy way to do this when the app starts up.
On iOS, there is a brief message shown at the top of the screen when the app starts up, if you click on that, you can change to a different user.
On Android, there is a notification that you can reach by pulling down from the top of the screen once the app has started. Click on the notification and you can change user.

Sending a command from a web-browser to an app

I want to be able to send a stream of data from a user computer to a web-service. That should not be too hard - I would use an application written in dot-net that resides on a user's Windows computer.
However, the tricky part is that the stream-of-data should only be sent (by the app) when the user clicks on a button or a link in a WEB PAGE that is open in his browser. The app itself would be minimized in the system tray. And he should be able to stop the stream by clicking on a stop-button (or link) in that web page..
So I found some info on stackoverflow that says that you can put a link in your page, something like: [a href='alert:"Hello World" ' ] and if you register your application (in this example the app would be called "alert.exe") in the registry, then when the user clicks on the link, he will cause the application to start, and to receive "Hello World" as a parameter.
Anyway, there are complications in my case. I want to be able to tell the application when to start sending data, and when to stop sending data, without starting new instances of the application. If the user clicks START, and the app is already open, I don't want it to open again. I do want a message to go saying "start sending" and if the user clicks on a STOP button (or link) to say "stop sending". The user might click on these web-page buttons several times in a session, and I don't want to close and reopen the program each time.
So a couple of questions:
Am I taking the right approach? Would "plug-ins" be a better idea?
If I am taking the correct approach, is there some way to send commands from a web page to an application?
Is it safe to have my app modify the registry of user computers?
If so, is there a set of commands for doing that?
Is the registry supported by Windows 7, Windows 8, etc? I know it is not supported on a Mac.
Thanks in advance.
LL
P.S. (the info on launching apps from your browser was at: http://msdn.microsoft.com/en-us/library/ie/aa767914%28v=vs.85%29.aspx).

Selenium Web Driver - login event not launching

I'm using Selenium Web driver for testing, but can't ecen get past login page. The code I'm using:
driver.Navigate().GoToUrl(baseURL + "URL");
driver.FindElement(By.Id("loginForm:username")).SendKeys("uName");
driver.FindElement(By.Id("loginForm:password")).SendKeys("pass");
driver.FindElement(By.Id("loginForm:login")).Click();
Element locators are correct and login click is happening, but after that I am not logged in, but page is just stuck there - no error or something. Same code worked in IDE.
I'm using IE9 and also there is changed settings:
var options = new InternetExplorerOptions();
options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
driver = new InternetExplorerDriver(options);
Any advices how to overcome this problem?
This happens with me very often, but not sure if it is the same reason for you.
When you run the tests locally, all the actions (sendkeys, click etc) take place really quickly. The loginForm:login button could be kept disabled until the user enters text in fields loginForm:username and loginForm:password. So there is a possibility that the button loginForm:login could have not been active when it is being clicked.
So I would recommend using an explicit wait to check if the element id loginForm:login is displayed before clicking it.
This step is basically useless but all it does is simply waste some time between "sending keys" to the password text box field and clicking submit.
Also for a quick check you could also do something similar to sleep 2 (make the script sleep for 2 seconds) after entering the password and before clicking the login button.
IF you eventually plan to run this on a remote machine, you dont need to do any of the above two steps, the time delay due to communication between the machines will be sufficient for the whole process to work smoothly.
(The same problem occurs on the linkedin login page- Login button is disabled unless Username and password is entered, but the speed at which the webdriver performs each step, The login button is not active when being clicked on.)