Manually assign Browser to test in visual studio load test - visual-studio-2010

Visual Studio 2010 has the ability to run test scripts using different browser profiles. For a specific scenario with two scripts (script1 and script2) you can configure the Browser Mix to run 50% of your scripts as IE7 users and 50% of your scripts as mobile users.
The problem I am facing is that the mobile and desktop versions of a web site are completely different. So the same script that is recorded for the desktop will not run for the mobile. I cannot see any configuration or way to force script1 to only run as IE7 and script2 to only run as safari for iphone.
This is possible with many other performance tools but I fear given the simplicity of MSVS Load testing it may not be possible. Does anyone know if this is possible, the only way I can think that it might be is if somehow in each script I can override the browser mix setting?

So I found the answer. I was trying to add a desktop browser only test and a mobile only test to the same scenario. The key here is to create a separate scenario within the existing "load test" and have one just for desktop browser tests and one just for mobile tests, as demonstrated in the following picture, where the "Web Test" scenario will be split between IE7 and Firefox3, while the "Mobile" scenario will just run on a smartphone.

Related

UIPath Automation: Is it possible to perform click and UI interactions in cloud server in UI Path?

So I have created an xaml flow which clicks browser buttons downloads files and then does some basic operations. I setup a windows server and connected remotely to it and when I debug my process automation while staying on the screen it works smoothly, problem is that I can't keep my pc on forever so when I just minimize the file even though my system remains up and running:
The UI Path process kills as the button press times out. I was just curious to know if it's compulsory to keep screen up for the ui based process automation to run through or is there a way to initiate the process and then close the screen and let the system do its job?
This is the eror I get which is like first UI interaction:
Here are the steps I have performed:
Created an unattended robot with machine as the remote instance name.
Created an environment and connected with the robot created in step 1.
Setup UIPath Assistant using machine key and URL.
Published the files and then created the process in cloud console.
Ran it from cloud console.
The process faults at its first UI interaction. Even though it was running in unattended robot form.
Thanks in advance.
AFAIK this is intended by the licensing model of UiPath. So to solve the issue you need a license for the VM of your RDP connection that allows the unattended usage.
Another idea could be to start the process in the PIP (picture-in-picture) mode. But I have never tested that, so this might also not work.
But maybe you already have a license like that and could test that out.
These are our types:
Solution for UiPath Studio 20.4 or higher
For my Use Case Picture in Picture mode worked correctly. Thanks #kwoxer for the suggestions, though his answer was enough but I am adding it up here for those who may need future reference.
So If you're facing issues with automating user interactions in dynamic JavaScript Website over a cloud server that loads on demand (When you minimize or close your remote session, the process times out as it's not able to find the UI component), here are the simple steps to follow:
Goto Debug options on top and select picture in picture as shown below:
This basically lets the bot start the system from another node. Now when you run the system and even close the remote connection, the automation process including all sorts of UI interaction will work like charm. Please let me know in case someone faces the issues with the same. Would love to help!

Visual Studio for Mac for Mobile Devices (Xamarin) - C# Automated Unit Testing

It seems really bizarre that Visual Studio for Mac (the recently-renamed Xamarin Studio) doesn't support automated unit testing for their mobile device (Android/iOS) applications. Actually, I guess it isn't that bizarre, they REALLY want you to pay for their cloud testing service.
How can I run my own automated unit tests, on my own machine? Here's what I mean by that - I want to create an application that:
Contains C# files containing unit tests that require NO user interface
Can be invoked from my Jenkins or Hudson automated build server
Can run on either a physical iDevice attached to the build server, or the iPad simulator
Runs all unit tests, reports their pass/fail status back to the build server, and then exits, all without any human intervention.
It seems like I could do this on the simulator using
xcrun simctl spawn
and then either
Have my test app writes its output to its storage and figure out where on my Mac's hard disk the simulator storage lives, or
Have my test app send its output to the simulator's pasteboard and grab it using
xcrun simctl pbpaste
But these both require that I find a way to write a C# app that runs on iOS, runs my tests, stores the output where the "real world" can find it, and then shuts down.
And I have to figure out how to copy all of the necessary EXEs and DLLs over to the simulated iPad? Or have Visual Studio package it all into an actual Mac app?
To run unit tests on an actual device you can use NUnit.Xamarin. This is a library that creates a Xamarin.Forms app that you can run on the real device, and this app will look for unit tests and run them:
https://github.com/nunit/nunit.xamarin
You have to run this manually as an app and look at the results. If you want to automate that part then you can create a Xamarin UITest automated test to launch your app, let the tests run then download the results.
https://developer.xamarin.com/guides/testcloud/uitest/
This is something we do using Jenkins as part of our standard mobile app pull requests. Jenkins runs a script that runs the UITest unit tests to launch the unit test app, wait for a result then grab the output and either pass or fail the UI test depending on the result of the screen output.
We just look for 'Test passed' or 'Test Failed', and if the test fails we manually run them to look for what went wrong, but you could expand on the UI test to download the results.

Why CodedUI test runs in one browser and does not in another with the same version

I have a few automated UI tests implemented with CodedUI. I have a virtual machine where the tests are run by Test Manager (via test controller and test agent). The benefits of this set up is that I can do other work while the tests are run. If I use my desktop to run the tests.
Recently, these tests are failing. The test is not able to step over from a input field to input password field. So, every test fail due to the tests can't log in to the system under test.
When I run these tests on my desktop then the tests are run without any issue.
Since the tests have been failing there were no updates on either system. Only, restarts.
Both system is Windows 7. Both has the same IE10 version. I requested a new virtual machine and the issue is the same. Tests are failing.
I'm in the situation where I can't decide which way of working is the proper. I want my tests running on the virtual env.
Have anybody experienced like this? Do you know any method to identify what could be the problem?
Another part of the situation is that, if I set up the tests to run on Chrome, then they are running, but it seems CodedUI doesn't like working together with other browsers than IE. I got some "method is not implemented" exceptions. I feel this would be another hell.
First of all, Coded UI only works with IE, unless you use Selenium components.
If you can, add the error the test gives after failing.
In any case make sure your test machine has access to the system you're logging into. To run a Coded UI test on a remote machine you also need to have a user logged in.
The root of my problem is really simple, however annoying and this is not the first I'm looking for when I experience issue. The browsers I use for test have different Browser Mode and Document Mode settings.
That one where the tests failed had "Browser Mode: IE 10 Compatibility Mode" and "Document Mode: IE 7 Standards".
The another one where the tests have passed had "Browser Mode: IE 10" and "Document Mode: quirks".
I modified the browser set up values and the tests are running properly.

watir - file_field not working when running on server

I am currently writing features to upload an image using the file exploer in ie.
Locally this works fine and opens the file explorer and locates the image without any problems. However when i run it as part of the acceptance run ont he server it self it fails to open the file explorer, It will just sit there waiting for it, it doesnt even time out at the usual 60 seconds so i assume something is trying to happen behind the scenes but is failing silently.
Has anyone had this issue and found a fix or work around for it?
Most servers have IE very locked down by default since very little browsing is typically done from servers, and the browser itself represents a significant attack surface. See here for more info http://msdn.microsoft.com/en-us/library/ms537180(v=vs.85).aspx
The result is that unless you disable this enhanced security there are a number of things that just flat out won't work. If you are running your test from the same server where the website is installed, then you will need to disable all the enhanced security stuff on IE.
This would be a violation of best practices for a production system, but is an understandable expedient for a test system as an alternative to having a pair of systems with different OS's (client and server) for your testbed and running the tests on the client. (more realistic, but requires another system or VM be created and maintained)

Forcing loading of Asp.net development server with DEBUG for testing wcf service (nunit)?

can anyone help?
I have a solution in vs 2010 which contains a WCF Service application and a class library which has a number of Nunit test.
The nunit tests the service. Problem is that there is no Asp.net Development server running - is it possible to force it to run under debug mode..
I can press F5 but then i can't run my tests.
Maybe i am doing this all wrong, should i host them under IIS 7 ? rather than the built in development server.
That way the server is ALWAYS available rather then loading on demand
See http://www.codeproject.com/KB/aspnet/test-with-vs-devserver-2.aspx for a very lightweight and, in my biased opinion, elegant way to integrate webdev/cassini into your testing environment.
NOTE: the first example of controlling the .exe is for edutainment purposes only. Read through to the second, very brief, code sample for the money shot.
Update:
I use the technique listed above with nunit and most every unit test runner around, including continuous integration on servers that I do not control, extensively with great results.
When I need to simulate a real server with a host name and non-loopback ip address, which WebDev.WebServer and WebDev.WebHost cannot do,
I add the host name to my hosts file, e.g. localhost.skysanders.net 192.168.0.10
use the CassiniDev .dll in almost exactly the same way
it is so simple and bullet proof it should be illegal. ;-)
CassiniDev is also a perfect replacement for the WebDev.WebServer.exe for VS 2008/2010. It has integrated traffic monitoring and is quick a bit faster, both at startup and at processing.
I haven't tried this but since you haven't gotten any other responses:
http://xneuron.wordpress.com/2009/03/27/launch-cassini-using-command-line/
This looks like a command you could add as a pre-build step to your NUnit tests. Hopefully Resharper honors those commands and ensures they're run before doing its own test-specific builds.
I have a solution with exactly the same layout. I would much rather test them in IIS since that is where they will be deployed, and it's nice to know that the code definitely runs under the restricted IIS account rather than my domain account. I run the unit tests as follows:
Make sure IIS is running.
Right-click on the WCF Service project and Publish to IIS.
Fire up NUnit on the client test project and run the tests.
If all tests pass, then great, Otherwise...
Leaving NUnit open, switch back to Visual Studio, and attach the debugger to the IIS worker process (aspnet_wp.exe on my dev machine).
Switch back to NUnit and re-run the failed tests. Any exceptions and breakpoints will break into the debugger as normal.
Rinse and repeat as many times as you like.

Resources