Login page tests monitoring from grafana - automation

I need to run an automated login test on an web page and the result should be displayed on a dashboard. It is to display the status of the login page whether it is down or not, on a dashboard. The status should be displayed as UP if the page is available and able to login and considered as DOWN if it is not possible to login.
Is it possible to do this from Grafana or is there any plugin available to do it within Grafana?

Related

protractor microsoft single sign on Automation

I have a web page where I have a log in button. Once I click on the Login Button it takes me to Microsoft single sign-on screen, Where I give my username and password, But I have two-factor authorisation enabled too where a code is received in my registered mobile.
I am not sure how can I automate this and all the functionality sits inside this login page.
How can I automate this in protractor, Could not find any resource to achieve this!!

Simulating web site with remembered user in selenium

I'm collecting user actions from a web page. For example; www.test.com/home. After that I'm simulating user's actions in same page with selenium. But user logged in test.com and browser remember this(with cookie, storage, firebase, google account etc. Doesn't matter).
When I open www.test.com/home with selenium in another server, of course browser doesn't remember user's login credentials and opening login page.
Is there any way simulating a page in another server with remembered user.

How to restore all the page information after logout using cookies on Selenium

After we click logout, the session expired and we can no longer use the store cookies to login the same user right? We are facing a situation where the same user would login to a system several times during the entire test suite, and we want to be able to restore all the page information that the user was on for various test case.
For example, User A login and navigate to page (Page-10) and then logout. After some time, User A login and navigate to page (Page-14) and then logout. Then, we want to be able to have the User A login and restore all the page information and direct the page to Page-10 without going over all the navigation process.
Or just login to an user and have all the iframes I open on the previous login. Anyone has any idea on how to do that?

How to achieve "Remember Me" functionality for both local and remote login pages?

I have a requirement in my application for iOS and Android, developed using IBM Worklight, to remember the user ID if the user selected this option.
I can achieve this by using localStorage, but the issue is that I have two login pages:
One is placed within the application, and the
Second is hosted on a remote server
Depending on the conditions the application will meet, either the remote login page will be displayed or the local login page will be displayed.
If I use localStorage on local page it is not accessible for server side login page. So I want to use some storage/file on the mobile to store my user id which is accessible for both local and server login page. Is this is possible using worklight/phonegap storage?
More explanation:
Remote login page is hosted on some www.xxx.com domain. My requirement is on launch of application the local login page is shown to the user, there user can enter user id and password and selects remember me option and submits form. Then user logs in and navigated to some xxx.com/yyy server page. From there when user clicks on log out it navigates to remote login page which is hosted on www.xxx.com server. As user already checked remember me option in local page the remote login page has to pre populate the user id text box. And same scenario should happen when user enters credentials in remote login page and selects remember me check box. So when user kills the application from background and relaunches the application user will get local login page where I need to pre populate the user id last time he entered.
Short answer: in my opinion, no.
Longer answer: I will explain what I think using your scenario:
Remote login page is hosted on some www.xxx.com domain. My requirement
is on launch of application the local login page is shown to the user,
there user can enter user id and password and selects remember me
option and submits form.
So far so good. You can store it in either Web Storage or JSONStore or use Cordova File API. Catch: all of these are available ONLY for the specific application.
Then user logs in and navigated to some xxx.com/yyy server page. From
there when user clicks on log out it navigates to remote login page
which is hosted on www.xxx.com server. As user already checked
remember me option in local page the remote login page has to pre
populate the user id text box.
Still plausible. Lets say the user selected 'Remember Me', so you can adjust the URL pointing to the remote login page and send with it as parameters the username and password. Assuming that there will a mechanism to handle those on the remote page.
This does not come for free, though.
This is not meant to work out-of-the-box. It's worth noting that whether Web Storage (localStorage...) is used or any other type of storage- the application and the Cordova InAppBrowser do not share the same localStorage, and the same is true if you open a new WebView.
And same scenario should happen when user enters credentials in remote
login page and selects remember me check box. So when user kills the
application from background and relaunches the application user will
get local login page where I need to pre populate the user id last
time he entered.
This is also a problem IMO, because any application is sandboxed - be it the browser app or the Worklight app, each of them is sandboxed. so you can't just go to website X, and create some localStorage for it and expect that data to be available for another WebView belonging to another app. That's the whole point of sandboxing, in order to protect the app.
And in this case, where the remote "page" will save the data, only Web Storage is available anyway, as JSONStore requires the Worklight API, which is not available when you load external websites.
Notes:
Since you want to save both username and password, you'd probably want to encrypt them in some way, so JSONStore and WL.EncryptedCache are your options, rather than plain Web Storage.

expressJS rendering login bootstrap modal if action is not authenticated

I am writing an expressjs/ejs app which is using Twitter Bootstrap 3 for web pages. I have used Bootstrap Modal for login. I have included the modal in the header section so it is available for every webpage. However, if a user has not logged in, he needs to be authenticated before performing certain actions on the app. I am using a middleware function to determine whether a user is logged in, however if a user is not logged in, I need to redirect him to home page and initiate the login model directly. I am not sure how I can initiate the bootstrap modal from server side. Any thoughts?
I need to be able to do:
response.render('/home#loginModal');
That way user is directed to home page and is given a chance to login.