How to test frontend app step by step by scenario? - testing

We have a web project and the main business flow is going through the chain of processes (conveyor). We don't have any automatic tests for front. So, to test we use our "hands".
What I want to do is to create some auto test that goes through every step and every window that I do always using hands from my browser.
Any suggestions?
P.S. I don't have an access to frontend app. All I have is the running app on my browser :)

In my experience with quizzes/wizards, such using gamification logic and transitioning from screen to screen - I had to properly plan my efforts.
test that goes through every step and every window
Is easy to go way overboard with all possible paths, resulting in combinatorial explosion. As general advice, try limit the really critical scenarios and cover first those. It is quite likely that the conveyor engine, follows same basic (business) rules and just combines them to produce the flows. In other words, bugs are most likely to be found in the codified domain logic, than the mechanics behind them.
Since this is an Angular app and we all know how pesky Selenium is with it. I would go with Protractor as it is built to handle
native events and browser-specific drivers to interact with your application as a user would
and
supports Angular-specific locator strategies

Related

Setting values whitout UI interaction. Cypress app actions

Guys! I'm kinda new in cypress and was looking in this link (https://www.cypress.io/blog/2019/01/03/stop-using-page-objects-and-start-using-app-actions/ )to see the diff between page objects and app actions. Since app actions are brand new, i was not able to find any documentation to help me out. In the link above, there was an example of how to predefine values ​​on the page so no UI interaction is required. I was able to follow the steps and realize the changes here, but i don't know how to do that outside this example.
How could i manipulate cypress application to do that?
Skimming the article, the idea of application actions is to export an API/hooks from your application that your test can use to interact with the app (its model, state etc.), for the purpose of speeding up certain workflows (such as seeding the model), awaiting certain events etc.
There's nothing magical about it, but it requires knowing your app architecture β€” what you need to export (i.e. expose on the window object), and how to interact with it. If you're not the developer of the app (e.g. you work in a separate QA department), and treat the app as a black box, then you'll need to discuss with the dev team how best to implement this.
Each app is different, and depending on the app architecture (What framework does it use? How does it store state/model? etc.), each solution will be different.

Desktop application accessible by multiple users

I have a desktop application [Data Analysis and Report Generation] built in VB. I would like to make this application accessible to all the users in our corporation, from their web browsers. What is the best possible way to achieve this?
One way which I have thought is to write a simple web form that would take the input from the user and apply logic on the server and generate results. Again, the limitation would be at the output screen as it is the real time output being generated.
Any leads would be highly appreciated.
Desktop App is way different from web app. To allow multiple users, a web app is suitable. For this you will have to use several technologies.
The UI has to be build using html, css and javascript (like jQuery).
The back end, can be VB if you are doing working with asp.net or php etc.
For real time output, you'll have to use ajax to allow communication between a browser and sever without page refreshes
An ideal choice for the front end logic, would be to use a frontend framework such as AngularJs by google.
However, all this does have a high learning curve and is difficult to build something using all this on the first day or even week unless you already know most of this.

How to properly benchmark / stresstest single-page web application

I am somehow familiar with benchmarking/stress testing traditional web application and I find it relatively easy to start estimating maximum load for it. With tools I am familiar (Apache ab, Apache JMeter) I can get a rough estimate of the number of request/second a server with a standard app can handle. I can come up with user story, create a list of page I would like to check and benchmark them separately. A lot of information can be found on the internet how to go from novice like me to a master.
But in my opinion a lot of things is different when benchmarking single page application. The main entry point is the most expensive request, because the user loads majority of things needed for proper app experience (or at least in my app it is this way). After it navigation to other places is just ajax request, waiting for json, templating. So time to window load is not important anymore.
To add problems to this, I was not able to find any resources how people do it properly.
In my particular case I have a SPA written with knockout, and sitting on apache server (most probably this is irrelevant). I would like to have rough estimate how many users can my app on the particular server handle. I am not looking for a tool recommendation (also it would be nice), I am looking for experienced person to share his insight about benchmarking process.
I suggest you to test this application just like you would test any other web application, as you said - identify the common use cases, prepare scripts for them, run in the appropriate mix and analyze the results.
Web-applications can break in many different ways for different reasons. You are speculating that the first page load is heavy and the rest is just small ajax. From experience I can tell you that this is sometimes misleading - for example, you can find that the heavy page is coming from cache and the server is not working hard for it, but a small ajax response requires a lot of computing power or long running database query or has some locking in the code that cause it to break or be slow under load - that's why we do load testing.
You can do this with any load testing tool, ideally one that can handle those types of script with many dynamic values. My personal preference is WebLOAD by RadView
I am dealing with similar scenario, SPA application where first page loads and there after everything is done by just requesting for other html pages and/or web service calls to get the data.
My goal is to stress test the web server and DB server.
My solution is to just create request for those html pages(very low performance issue, IMO, since they are static and they can be cached for a very long time in the browser) and web service call requests. Biggest load will come from the request for data/processing via the web service call requests.
Capture all the requests for html and web service calls using a tool like fiddler, and use any load test tools(like JMeter) to run these requests using as many virtual users as you want to test your application with.

How to simulate 20 users click a button at the same time in Web GUI Test Automation

Now I hava a requirement about Web GUI TA
I want to simulate some users(20-30) click a button at the same time and evaluate the performance of Web GUI at that time.
I use RobotFrameWork + Selenium library to do the Web Gui TA before, but as far as I know. selenium library only can handle one broswer at one time, so i dont know how to do now.
Can you give me some advice? need use another library or framework?
Like mentioned by other, what you want to do in this case is not UI testing but rather stress/load testing. You should be able to try easily Gatling. First you record the http request associated with the click on your button. Then, you write a simple scenario that launches this request 20 times at once. Something like:
setUp(scn.inject(atOnce(20 users)))
.protocols(httpConf)
Selenium has a "grid" option you can use to configure many instances running many browsers.
http://www.seleniumhq.org/projects/grid/
http://www.seleniumhq.org/docs/07_selenium_grid.jsp
Grid allows you to :
scale by distributing tests on several machines ( parallel execution )
manage multiple environments from a central point, making it easy to
run the tests against a vast combination of browsers / OS. minimize
the maintenance time for the grid by allowing you to implement custom
hooks to leverage virtual infrastructure for instance.
In short, you create a "hub" that manages things, then each "node" can perform tests as required by the hub.
Consider, however, this may not be the best route to go down. Something like multi-mechanize might be more useful: http://testutils.org/multi-mechanize/
That will allow you to have many users "clicking" the button, but not via a browser but via direct HTTP calls. That might be more suitable for multi user simultaneous "headless" load testing, which is what I think you are attempting to do.
I'm slightly confused at this question:
Are you wanting to test the GUI? If it's something like "This button makes a dropdown menu appear", then it doesn't matter how many users do it at the same time, it'll either always work, or never work.
Are you wanting to test the server under load? If so, then Selenium will work, but there are better tools. I have used JMeter with success, but there is a really good listing of all of them here: http://performance-testing.org/
Finally, are you wanting to press 20 different buttons on the same page on the same browser at the same time? If so, this isn't possible with selenium, and it isn't a standard use case either.

What's the simplest/easier way to do a health check/smoke test in an internal web app?

I have an intranet web application and I would like to do a simple health check/smoke that runs once an hour to make sure that everything is how it is supposed to be.
The tests are supposed to do some requests and check response for text and in some cases do one or two POSTs to see if the application in answering like it should.
I thought about using Selenium or Visual Studio's WebTest and schedule the run via CC.NET or another CI application but seems like a big shot for a simple thing.
Any ideas?
Thanks
Selenium is a good option. So is PhantomJS.
I dare to say that SWAT could be a good choice for you. It does exactly what you say - makes various http calls and check data returned, also it is possible to pass the test results to different report systems, using TAP format which swat is compliance with. And finally there is a simple DSL to write such a checks.
Regards, the author.