How To Ignore and error in Visual Studio WebTests - visual-studio

I'm using Visual Studio to record some web tests. I'd like the test to pass (obviously), but it is failing because of something out of our control - so I'd like to surpress that failure.
One of our pages is using an API from a third party like say, let's pick on, facebook. (It's not facebook, but for sake of argument it is). Let's say that we're using the facebook open-graph api to do something or other, and one of their 1px gif files is not found because one of their developers made a typo in the filename. They don't know it's not found, and the API works perfectly with that request erroring out. I want to surpress the error in the web test upon loading mysite.com/index.aspx because it's an inconsequential error.
Thanks!

Just turn off the propety called "Analyze dependant request" for that specific request in your web test.
Not shure for of the property name, I got the french version of 2010.

In English VS 2010 it is "Parse Dependent Requests"

the problem with turning off the "Parse Dependant Requests" is that the page doesn't actually call them either. In a page that has many images you can clearly see that there is a significant difference in the response time of the page when you have dependant requests on or off.

Related

What to do about "The Components object is deprecated. It will soon be removed." in dev tools Console

For almost every page I open in Firefox, I see this error in the Console of the developer tool bar:
(!) The Components object is deprecated. It will soon be removed.
The source is the html page. It happens with pages I create, but also on many common websites.
I found this documentation on Components object on MDN web docs, but that does not clarify a lot. Note that even that page shows this message(!)
It looks like a warning, but according to the Console filter, it is an error.
My main questions are:
Is this something for me, as a developer of the page reporting this, to solve?
If so, how do I go about that?
I am not aware of any problems as a result of this. For now, that is.
I have seen this for over a year, maybe longer. I mostly ignore this, but every now and then it starts nagging me again. I don't want my code to break suddenly and would like to get rid of this message obscuring other messages.
This is not for the developer of the page to solve.
While biking back home, a possible cause popped up in my mind: could one of the add-ons I use cause this and yes, that appears to be the case.
I restarted with disabled add-ons and the message was gone.
Then I enabled them one at a time and the culprit is
Selenium IDE.
A bug report on this issue was closed with Won't fix, with the message:
This error will resolve itself when we move to a native app later this year.
In a MozillaZine topic of 2012, it is explained how it could have been solved.
The first one is just a warning that the addon is using "Components"
directly, which won't necessarily always be possible when using the
Add-on SDK. (The preferred way to do it is to access the aliases for
Components.classes and Components.interfaces and such that the SDK
provides by requiring the "chrome" module.) It shouldn't be a problem
right now, but might become one in the future.
it happened for me after installing Selenium plugin in my FireFox.

Project is missing in api (hence octo.exe can't find it)

We're using octo.exe to create releases. It starts suddenly giving error saying can't find project. I checked the api/projects and that's true, it is not in the returned json response. But when I look at the dashboard I can see the project. The only thing I did was cloning another project from this one earlier. The cloned project is working fine but not the original project.
It exists in dashboard (web gui) but not in api (hence octa.exe can't find project)
Looks like api is caching the projects. The new projects that I created via GUI not available in api.
Thanks,
I have had the same issue yesterday. It turns out to be something interesting. I believe that your project is still there properly set, but the total number of projects that you have become more than the listed ones in the API, and that's why the Octo.exe couldn't see it anymore.
I have explained here, how I managed to fix that issue quickly.
This is due to how pagination is implemented in Octopus (pretty poorly if you ask me). But you can override it. add this to the URL (at the end).
'?skip=0&take=2147483647'
alternatively, you can watch the json returned, if you find the links.Page.Next property you can use that link to get next page of the api response.

Watin and Telerik Controls

I would like to ask if anybody knows an easy way to test Telerik controls with Watin.
We are about to start using it but before we do I wanted to see if there is anything I would need to know.
The problem that I can see we will be having is that if even smallest thing changes then all our tests will also break.
Any suggestion is greatly appreciated.
The problem that I can see we will be having is that if even smallest thing changes then all our tests will also break.
This could/will be true of all portions of your pages, including Telerik controls, depending on your test structure. Ideally, your elements will have IDs assigned and you'll use Page classes and custom control objects to remove all HTML references from your actual test code. Then if something changes on the webpage (or in a control), you verify the change is expected, then you change the WatiN page code (or control code) and re-run your tests.
The WatiN page class primer is here: http://watinandmore.blogspot.com/2009/06/introducing-page-class.html
Basically, you want to have your test code look like myPage.PickDate("3/29/2012") and not like ie.Tables[3].TableRows[2].TableCells[4].Textbox(Find.ByClass("datePicker")).TypeText("3/29/2012")
Changes can, do and should result in failing tests, however, I can attest that with a good page (or control) class setup that abstract away the HTML DOM and other specifics leaving non-HTML-filled test code, means that when changes do happen they are most often easy to get working again.
Note: Selenium also has a Page class concept, but I have not used it very much as of right now. Bottom line: If you write a lot of tests that reference the HTML DOM directly in test code, you're setting yourself up for a maintenance headache regardless of if you go with WatiN or Selenium or whatever.
Added: As to your original question: Can you work with Telerik controls in WatiN? Yes you can most likely, but depending on the control you may need to get a bit creative, possibly even calling javascript methods from within your test (page object ;) ). I've been stumped by a couple controls (non-Telerik) but most I've eventually figured out.
I realize you asked about WatiN, and I know I'll probably get downvoted into oblivion, but I might recommend Selenium instead. It seems to be more widely used and when we were evaluating the two we found Selenium easier to work with because of the Firefox plugin to record/generate the tests. This meant that our non-technical folks could set up the tests.
Since then we've successfully used Selenium to test ASP.NET sites that utilize Telerik controls. I only ran into one issue, with the RadNumericTextBoxes, which I've documented a fix for here: http://www.msigman.com/2012/02/entering-radnumerictextbox-selenium-webdriver-1-6-0/.
I'm currently in the process of writing a how-to guide for doing it: http://www.msigman.com/2012/03/automated-testing-asp-net-web-application/ (shameless plug).
You should also consider evaluating Telerik's Test Studio, our functional automation test tool. (Disclosure: I'm their evangelist for Test Studio.)
Test Studio really shines when you're working with Telerik controls. You'll get some great additional functionality around being able to dive deeper in to verifications and actions around the controls.
Even more importantly, Test Studio handles centralizing locators and pages by default, so you don't need any additional effort to best manage your UI changes.

How to debug a program that doesn’t throw any error

I’m having trouble to find a bug in my application.
The problem is random and don’t throw any error. The web site just keeps loading and loading and eventually gets a timeout.
Is a web application using MVC 3 in VS 2010 Pro.
Some time ago, I see a friend to write something in the url, and gets all the trace of the program…
Sadly, I don’t remember what the command was.
Anyone has an idea of what command is it?
Any suggestion on what to use to debug?
Thanks!
Edgar.
UPDATE!
I finally found the command... is trace.axd
But Its behave the same way... sometimes load without problems and show me all the trace info... and sometimes.. it keep loading and loading...
Maybe something related with IIS?
Turn on break on every thrown exception, run your application in debug mode and wait. If it executes too long then pause application and check where you are or wait for exception that is handled somewhere.
Your friend may have had something like the following built into his application, to dynamically set tracing on.
Trace.IsEnabled = Request.QueryString["trace"] != null ? true : false;
This provides info only if the page is fully loaded. It's probably best if you use the VS debugger to step through code.
If all you loops look ok, investigate code that could result in circular references or deadlocks. These can be difficult to spot sometimes, look for functions or constructors that require results from a calling class. So code that needs the result from a function which in turn need results from the first.
Well, this sounds like you have an infinite loop somewhere.
Look at the code that runs when you visit the URL that gives you trouble. See if there is any loops in there (for/while). If yes, see why if they never exit. You can do this by putting a breakpoint inside the loop and examining its behavior over the iterations.
in MVC the bugs you do not see are most of time (especially in Razor and Ajax work) view compile errors. Sometimes syntax bugs on views just does not show that view and do not stop working.
Try that:
put a breakpoint in view.
If program stops in there it means this view is working. Othervise there is a syntax error in this view.
Another way to see some bug information more than in visual studio is use browser tools.
I use google Chrome. Just open developer tools in it. Open network. And do your request. It will list the requests and responses. Click the response and see the information. After style (it is written Verdana etc) read exception details. Sometimes there is more information :)
I am using MVC 3 in Razor from start. So this is a small bug in asp.net mvc.

IIS Express fails to serve cshtml files

I've just started checking out WebMatrix, and am running into a problem. I performed a fresh install of WebMatrix, then started a tutorial which involves creating one small cshtml file. Whenever I try to run the site, I get the following error:
This type of page is not served.
Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension '.cshtml' may be incorrect. Please review the URL below and make sure that it is spelled correctly.
Requested URL: /Home.cshtml
In the IIS Express Requests section, the page request shows the following error:
404.17 Dynamic Content Mapped to Static Handler
Details: The requested matched a wildcard mime map and was matched to the static filder (What's up with all the typos MS?) handler. However, if the pre-conditions were different, the request would map to a different handler. This can mean that the pre-conditions are incorrect.
I tried reinstalling to no avail. Does anybody have any ideas?
I am running Windows 7 Pro, with IIS 7 installed. (IIS Express is supposed to be able to run side-by-side no problemo)
Thanks much!
It was set to 4.0 -- Uninstalling and reinstalling ASP.NET Web Pages did the trick.
It seems you selected 2.0 .NET framework in Settings section (in WebMatrix). Change it to '.NET 4 (Integrated)'.
Same boat - just toying with it and its "integrated workflow" with VS2010..but alas, it's not as "clean" as one would hope (or maybe just needs more manual tweaking of knobs and switches).
But try this (instead of, or before giving up all hope and re-installing): run Webmatrix in Administrator mode (right click -> runas).
Your solution is something I had to do on the server side though (IIS6/w2k3)....via web platform installer. While it seems odd to install Webmatrix server side, I just gave up and did it anyway to ensure all the dependencies are installed along with it (didn't want to spend or rather waste any more time figuring it out).
Worked for me....after looking glassy eyed with that "but it was working fine yesterday" look. So I hope this saves you (and anyone else) some time and frustration.

Resources