How to test the front end performance of web page with a user token - performance-testing

I have a web application where the user needs to enter the user name and logging to the web page. I need to do a front end performance tests in the pages which loaded after user logging on to the web site.
After login to the web page, web page uses a user token to handle the uses session. Is there any tool/way to do front end performance test for this type of scenario.
I tried with the www.webpagetest.org but analysis stop from the login page it won't go to the page after the login page

You need to use protractor that helps you in this. For reference kindly go this page.
Basically, what it did for you, it runs tests against your application running in a real browser, interacting with it as a user would. It's an end-to-end test framework for Angular and AngularJS applications. Also able to perform testing on other framework too.
For more testing frameworks. kindly go here.

Related

How to embed a web browser inside a web app made in node.js ?

I currently have a web app made in node.js. One feature of this app is to take notes. I want to provide the user with a way to browse the internet and select a text to add as a note in our web app without having to manually copy-pasting from one browser window to our app.
I know I can do this relatively simply using a Chrome extension that would be linked to the user account and would save the note to the database. However, I cannot use this approach since not all my users can install Google Chrome.
Therefore, I am looking for a way to browse the web from inside our web app. For example, it could be in an iFrame where we display a complete browser. That way, the user could navigate the web for information from inside the app, select text to save and click on a button (probably located outside the iFrame browser) to save the selected text as a note in our database.
How can I achieve such a thing in node.js ?
This is, essentially, impossible.
For you to get any data about the site the user was browsing you could either:
Restrict them to browsing sites willing to partner with you to give you permission to access their data via postMessage (a technical change on their part to work around the Same Origin Policy)
Proxy every request through your server which would:
Have large bandwidth requirements
Require a lot of rewriting of URLs (including dynamically generated ones in JS)
Require rewriting of X-Frames-Options and Access-Control-Allow-Origin headers
Need users who would trust you with all the data you passed through your system (including their passwords to third party sites)
Not work for Intranet sites (since your server could not reach them)

how to make a login page outside the single page application in angular js

I have an angularJS single page application. It is an admin dashboard. However I do not want anyone to access the dashboard unless he is logged in.
This is extremely broad. But you can look into route guards and canActivate from angular. Very similar between angularjs and 2/4. https://angular.io/api/router/CanActivate

Unable to log in to Azure web app via VS2015 web performance test

How do I correctly handle the login/authentication scenario for an Azure web app in my VS2015 web performance test?
I created an XML file as a data source for the WAAD username and password. I bind the username and password to the Form Post Parameters: login and passwd respectively at request: https://login.microsoftonline.com/xxxx/login
But when I run the test, the Web Browser tab shows this error:
We can't sign you in
Your browser is currently set to block JavaScript. You need to allow
JavaScript to use this service.
To learn how to allow JavaScript or to find out whether your browser
supports JavaScript, check the online help in your web browser.
I also get a number of errors like this:
The value of the ExpectedResponseUrl property
Validation xxxx.azurewebsites.net/xxxx/docs/xxxx.aspx does
not equal the actual response URL
login.microsoftonline.com/xxxx/wsfed. QueryString
parameters were ignored.
Any idea how I can successfully log in to the Azure web app via the web performance test?
There are several methods of login and authentication that can be used. Just binding values to form post parameters may not be sufficient or correct. You will find the login form has hidden session identities that must be passed as well as the login data. I find that recording a test two times using as nearly as possible the same inputs and doing the same activities helps. These two tests can then be compared to find the dynamic data that needs to be handled.
In a comment the questioner added "I noticed these parameters, n1-43 are different but I have no idea what they represent. How do I handle them?". I can have no idea what they represent as I do not know the website you are testing. You could ask the website developers. Or, better, treat them as dynamic data. Find where the values come from, save them into context variables and use them as needed. This is basic web test development. Here and here are two good articles on what to do.
The message about JavaScript not being supported can be ignored. Visual Studio web tests do not support JavaScript or any other "active" parts of a web page, they only support the html part. Your job as a tester is to simulate what the JavaScript does for the specific user journeys you are testing. That simulation is generally just filling in the correct values (via context parameters) in the recorded requests.
Unexpected response urls can be due to earlier failures, such as teh login not working. I suggest not worrying about them until all of the other test problems are solved. Then, if you need help ask another new question.

Azure App Services - login to test page

I'm trying to login to the App Services test page so I can open the help page but I can't seem to find the login credentials anywhere. Any idea how can I log in? I used Mobile Services before where I can find this pretty easily: https://blogs.msdn.microsoft.com/musings_on_alm_and_software_development_processes/2014/10/23/azure-mobile-services-prompts-you-for-a-username-and-password/ but this article seems outdated for App Services.
That is the default configuration Home page. There is the .UseDefaultConfiguration() method invoked in the Startup.MobileApp.cs. The part of that is the AddMobileAppHomeController() which depends on the corresponding Microsoft.Azure.Mobile.Server.Controllers.HomeController reference. You may want to remove that from the configuration and add the configuration and the view that you want to see (i am not sure that MobileAppHomeController page you see can be customized). Reference

Can a ClickOnce application return a value to the page that loaded it?

I have an online ClickOnce application that launches from a web page. After the application is closed, I would like the user to return to that page with some results passed from the application. Is this possible?
Right now the only solution I have is for the application to upload the results to my server, and have javascript on the launching webpage to poll the server every 15 seconds as it waits for results.
No. It is not possible to pass information directly back to the client browser from the ClickOnce installed application.
Your intuition is correct that you should have your application upload results to the server (presumably with the help of WCF) for subsequent processing and display via your polling page.
I'll also add, that in terms of your web application linking to data from the ClickOnce application you will need to come up with a common token between the web application and the ClickOnce application. Perhaps via a customised activation URL link that uses a common GUID generated for the client (e.g. http://myserver.com/myapplication.application?id=18c40c3d-183c-4c22-8127-37cac3be6492).

Resources