Coded UI Test Builder fails to generate code - visual-studio-2010

The coded ui test builder is failed to generate code. i created the new test project and added the coded ui test file. i have chosed the option 1.Record options then the Test builder is running.
when i record the actions and trying to generate code
it is throwing error
"Object reference not set to an instance of an object"
Kindly help in this.

There is no simple answer to this from the very small amount of information in your question. Searching the web for the error message (eg searching for "coded ui Object reference not set to an instance of an object" and variations) provides many cases of people getting the same message plus, in some cases, their solutions.
One possible cause is that the UI Map file has been edited in a text editor, leaving XML that the Generate tool does not understand. Another possibility is that Visual Studio has become corrupted and should be reinstalled.
To narrow down the possibilities, determine whether the problem is specific to one project, to one computer or to one user. Try creating a new Coded UI test in a new Visual Studio solution to drive a simple application (eg the Windows Calculator) and see whether the generator works OK. Copy the failing project (and the whole solution) to another computer and see whether code can be generated there. Try logging in as a different user on the same computer and generating code for the same project and for different projects.

Related

Data driven works on Performance testing but how will it work on load test

I have created Web performance testing using visual studio 2017, Most of the pages are data driven by Login, Change of lists etc is there
I have added extraction rule, and when i do load test of the same WPT it gives me errors 403 and fail's the test
My question here is how should I make it work
Thanks in advance
A 403 error usually means that your VS script is failing at login. It is most likely happens due to one or several dynamic values that VS plays back as recorded. To fix it you need to find and manually correlate them by creating extraction rules and parameters somewhere at the beginning of your script.
It looks like you already created some extractors, but if your script is still failing, chances are that you did not create all of them. Try the manual correlation technique described in my article.
Or check our Web Test Builder for Visual Studio referenced here to automatically create missing extractors and parameter.

Web performance testing with datasource in vs 2012

I'm having some issues with my web performance test that I created in Visual Studio 2012. I've created a test to go through our order system, but on the first run of the test it has errors on the page where you select orders. If I run that same test again it seems to work.
Since I am using a data source containing usernames and passwords, I only have one performance test and it runs once for each user in the data source. When it runs it passes the first test, but each additional user causes errors on that page which results in an empty shopping cart. It seems like an issue with POST variables not being generated or passed for each user after the first in the test.
Does anyone know how to fix this without having to create a web performance test specifically for each user? Using one performance test with a data source is so much nicer.
Thanks!
The web performance system is intended to allow data driven tests in the style you want. Your web site probably has some parameters that Visual Studio has not detected. The mechanisms built in to Visual Studio for detecting dynamic parameters are good, but not infallible.
First step. Just read through the recorded test including form parameters looking for things that may have been missed. You learn what they are through experience.
Another step. Record two versions of the same test, as closely as possible perform identical steps. (But do not worry about think times.) Then compare the two recorded tests. Look for form post parameters and other values that differ and consider whether they should be taken from earlier responses. Find which responses the values come from and write the appropriate extraction rules to create the context parameter.
It can also be worth recording and comparing two tests that are identical expect for user name and password used.
As well as recording tests with Visual Studio and comparing the files, it can be worth recording with a program such as Fiddler.
I have found that comparing the ".webtest" files with a good text comparison program helps find the differences, then make the edits within Visual Studio. If you are confident and keep backups you might edit the XML in the ".webtest" files.
Update: Note on comparing the .webtest files. Look at where the RecordedValue="..." fields differ but the associated parameter fields are not replaced by context variables.

MVC3 Code First, Cannot find Metadata

I'm following a tutorial (http://weblogs.asp.net/scottgu/archive/2011/05/05/ef-code-first-and-data-scaffolding-with-the-asp-net-mvc-3-tools-update.aspx) to build a simple MVC 3 web application. I'm using a code first methodology and things were going good until I had to go back and add a field onto one of my models.
I got the error "Invalid column name 'Summary'." Which makes sense because this was the new field that I had added to the model.
Its my understanding that whenever Visual Studio realizes that the existing DB is different from the one that it is connected to, Visual Studio will try to recreate the DB. This is the behavior that I want so I added the following line to my Application_start in my global.asax file.
Database.SetInitializer<MyDBContext>(new DropCreateDatabaseIfModelChanges<MyDBContext>());
Now when I try to run the program I get the error "Model compatibility cannot be checked because the database does not contain model metadata. Model compatibility can only be checked for databases created using Code First or Code First Migrations."
I even deleted the existing database that I've been using so Visual Studio doesn't get confused.
What do I need to do in order to get Visual Studio to nuke the DB every time I change the models?

VS2010 Updating Service Reference *crazy* Slow (like 5 minutes)

our team is starting to dread updating the service references in our solution because it's a 5+ minute investment. Everything is localhost inside Visual Studio's web server.
My question is - how can I debug what this problem is? It works fine once it is over, but the long delay is crazy. If I had a clue where to look, perhaps I could resolve this.
With VS2012, I ran into the same issue: it took me almost 10 minutes just to update one service reference. I just managed to fix this by re-adding the service in the following way:
Delete the service reference.
Right-click "Service References" and select "Add Service Reference".
Click "Discover" (required in my case, might be different for others).
Select the service that you want to add under "Services".
Give the service a name (under "Namespace" at the bottom").
Press "Advanced".
Uncheck "Reuse types in referenced assemblies" and press "OK".
Press "OK" to add the Service Reference.
For me, the reusage of types was the big issue: now that this is unchecked, new updates only take a few seconds. Since I couldn't find this solution anywhere else, I thought I'd just post it here in case others run into a similar issue.
More than likely the .suo files have gotten ridiculous due to constant refreshes. You can check this by examining the source. If this is the case, you can delete the .suo and update the reference. You might want to make a backup, just in case you forgot some other user settings you have.
The other option is the WSDL for the service has just gotten too damned large and you have to bite the bullet.
If you want to reduce the impact, get the service guys to nail down the contract by using a little known secret called planning. ;-) Honestly, poor planning is often the root cause for a lot of the issues that crop up in VS.
I noticed that using svcutil instead of Add Service Reference in Visual Studio leads to shorter generation times, albeit sometimes the code generated is slightly different (more on that later).
At work we have a WCF service composed of about 100 service operations and 100 service contracts and the proxy generation in Visual Studio 2012 starting from the WSDL exposed by the service takes about 7 minutes. I then tried to use svcutil (without any option) and the generation took only about 2 minutes.
I had to add some options to match the same characteristics configured in the service reference (/enableDataBinding, /serializable, /namespace:*,myns, /syncOnly and collectionType:System.ComponentModel.BindingList'1) and with this option the generation time raised to 3 and a half minutes. Overall the proxy generation is not order of magnitude faster but at least the generation time should be cut in half.
In my experience the two generation methods have some differences that I'd like to point out:
Visual Studio generates datasource files (the one generated by Visual Studio when adding an object datasource to a Windows Forms project, see also this SO thread); svcutil has no option for generating them. It shouldn't be a major problem, since the first time you need to databind to a contract the file should be generated by Visual Studio.
As an aside, if the proxy is compiled in a separate assembly, the referring project could not reuse the generated datasource files since they are not included in the assembly and they will be regenerated anyway.
the ConfigurationName property of the Service Contracts can be different, apparently because the two generation methods consider differently the target namespace in generating the attribute value. This is a problem in our case since we do not use the generated app.config. This however can be managed easily by changing the app.config to match the new value or by (automatically) changing the ConfigurationName property in the generated proxy source.
svcutil does not decorate the ExtensionData property with the attribute Browsable(false) -- this can be a problem if (like us) you use the data contracts as source for databinding in Windows Forms, since all grids now will acquire an additional column for ExtensionData. Like the previous hiccup, this can be handled by adding the attribute using a sed-like tool (for example, I used the PowerShell snippet contained in this answer).
I faced this same problem just now, and updating my service reference was taking around 10-15 minutes sometimes it failed to update. I was frustrated and finally I deleted the reference and then added it once again. And now everything is working fine.
So, I will suggest you to delete the reference and add it again and lets see what happens
Had a slow problem updating webreferences. I was crasy about the times. More than 1 hour.
Some co-worker told to to add my workspace path to exclude from Windows Defender and it solve my problem.

Making your own cusctom workflow developed in visual studio 2010 available in sharepoint designer 2010

Well my requirement is :
Need to develop a custom workflow,the workflow should take properties like site url, list names etc., From the client.
I am able to develop the workflow, but i need to make it available in designer. I tried the method mentioned here:
http://www.chaholl.com/archive/2010/03/13/make-a-custom-activity-available-to-sharepoint-designer-2010.aspx.
1)I have created the required action file.
2)deployed(copy-pasted) dll into gac.
3)made safe-control and authorized type entries in web.config of the corresponding web application(on which my site collection exists)
But it is not helping me out.after following the steps given,when i try to open any workflow in designer,it gives an error saying it cannot find an action(assembly) with xyz name.
If I understand correctly, you built an entire workflow and am trying to make it available to SharePoint Designer. The guide you are following deals with custom "Actions". Actions are a sub part of a workflow. This may explain why your deployment isn't working, because you're trying to deploy a workflow as an action.
If you could provide more information about your steps, we could try and figure it out.
Thanks
C
http://www.cjvandyk.com/blog

Resources