Codedui object map/properties recording settings - coded-ui-tests

Can anyone help me with this here codedui? I can't seem to find the option to choose when doing a recording on what properties for the object map to use. like for example,
when I do a recording for a calculator or "Something" and do an action/a click on "button 1" It just directly gets all the properties like, ID, name, classname etc. for that single object.
So, my question would be is there any possible settings when recording that I could tick like just use a couple of the properties not all? (ie. ID)
BTW, I'm using VS2010 ultimate.
Cheers,
Kerwin

UIMap editor that comes with feature pack 2 is the best solution for editing seacrh/filter properties of the control.

I have been working on something similar but haven't come up with a really good solution there are a few options but none of them are particularly user friendly or intuitive. You can hook the UIMap save function and prevent it from recording unwanted properties, note that this can make your tests brittle less properties generally means more failed searches. The UIMap is made by an XML file and you can parse and edit it directly. If you only have a few properties to get rid of you can use the UIMap editor that comes with feature pack 2.

Related

Android Studio: StringBuilder content not shown in preview of debugger

I'm implementing an app, which uses (kotlin.text.)StringBuilder instances at various points. Since today, I have to double-click the variable name and, after that, double-click 'value' to see the content shown as one character per line (next to 'value', it also says e.g. char[20]). Until yesterday, I was able to see their contents in the variables view of the debugger right after double-clicking the variable name and - what is even more important - in one single string line. I have to compare the content of several instances and therefore cannot work efficiently with this view.
Is there some kind of setting, which needs to be reset? Has anyone else experienced this? Is this an intended behavior or am I the only one having this bug/behavior?
After getting this, I already tried restarting android studio, as well as upgrading all components to the latest version. I also tried creating an entirely new project with only one StringBuilder to rule out any problems in my current project - but, no luck so far.
Any hint would be much appreciated!
You need to add a .toString() call to your string builder to get the value of the string.
I finally figured out the solution to the problem. It was indeed a setting I had to reset. As I did not actively change it, this solution might be useful to others, too.
Via 'Setting > Build, Execution, Deployment > Debugger > Data Views > Java', I found the option 'Enable 'toString()' object view:'. After selecting this option, everything worked again as before.
Thanks to everyone, who tried to figure out the solution!

How to get data from custom properties in UITestPropertyProvider

According to the code sample on MSDN (http://msdn.microsoft.com/en-us/library/hh552522.aspx) any custom property data that you need to get out of your control should be in a semicolon delimited string in the AccessibleObject's Description property. This does not seem right to me at all. This seems like just a quick and dirty trick to get it working. What is the correct way to get the value of properties from custom controls? And if this actually is how you're supposed to do it, then how are you supposed to set those properties using the SetPropertyValue method? The example in the link above just throws a NotImplementedException in SetPropertyValue.
Since the IAccessible interface has only a limited number of properties the best solution is to cram any extra information into the Description property (that's what they do at the company I work at, and our developers don't work quick and dirty :) ). To modify the return value of this property you have to implement the Iaccessible interface on your control. Or, since you only want to modify the Description property you only need to modify that property and leave the rest to the proxy (I'm not sure how this works exactly but there are tutorials for it on MSDN).
The SetPropertyValue method in the UITestPropertyProvider is for the UItestControls. By overwriting it you can modify the way CUIT interacts with the control during playback. For example, if you overwrite SetPropertyValue for the Text property you can change the way CUIT types strings into the control.

Editing a closed case

I have a ribbon button on the case entity that updates a single two-option field on the form via javascript. When this is used on a case that has been resolved/closed it returns an error as the form is now read only.
Is there a way in javascript that I could get it to re-activate the form, change the field and then put it back to the way it was before? I have tried to force the change on the form but even if i manage to make it appear that you can save it, it will return the error as the form record is still counted as de-activated, even though you can change the fields
Thanks
You should be able to use a SOAP call for this, its a little involved, I would suggest starting here. You have to generate XML that represents the request, the link provides some tools to do this.
I believe you will need to issue JavaScript versions of SetStateRequest (to open) and CloseIncidentRequest (to close).
On the other hand, which is a different approach entirely, is to disable the button when the record is deactivated, then users have to manually renable the record make the change and close again. This is closer to 'working with the system' which I have touched upon here, its a different situation but the principle still applies.

ReSharper - Is there any way to save code quality recommendations to a file?

I'm probably using the wrong terminology but basically I would like to dump the findings from the panel to the right of the scrollbar to a file for later review. See the screenshot below for what I mean. It's the part of the screen with the orange and green lines on. Does anyone know if this is possible?
If anyone is interested I have filed a feature request for this with JetBrains here.
As far as I know it's not possible, at least with the built in features. Maybe it's possible by writing a plugin.
The only thing which I know to get something like this:
Goto the 'Code Issues' Inspector: Resharper->Code Issues in Current Solution or any other of these options
On the window which shows the issues is a 'Export' button. With that button you can export the issues of the project/solution/file.
The report format is pretty simple list of issues as text. Like this:
5 issues found
Common Practices and Code Improvements (1 issue)
<DemoApp>\Program.cs (1 issue)
Property 'Title' can be made private
Potential Code Quality Issues (4 issues)
<DemoApp>\Program.cs (4 issues)
Auto-implemented property accessor is never used
Auto-implemented property accessor is never used
Class 'Comment' is never instantiated
Class 'Program' is never instantiated
It's now possible to use Resharper's Command Line to produce a xml with the issues on a given solution.
It's not exactly the 'export' functionality you wanted, but it might be useful still.
You just have to run the tool and pass the file where it will save the issues. For example:
inspectcode /o="D:\Resharper\MyIssues.xml" [PathToSolutionFile]
I've noticed this produces more issues than the plugin inside Visual Studio does, for some reason. I really think the Resharper's team should concentrate on using the same code to analyze the files instead of different implementations like it seems to be now.

DoDataExchange VC++ 6.0

I inherited an very old application that I am in the process of updating it (I know, we should have rewrote it in VS 2008, but we purchased a company, which is how I was stuck with the relic). Using UpdateData(TRUE) to retrieve the changes made in the dialog controls, nothing is being updated. I have an edit control, with an integer variable, and an edit control with a string variable, assigned using the class wizard. Upon pressing the OK button, the UpdateData(TRUE) is executed to retrieve the new values from the disalog.
I seem to remember having a similar problem back when VS C++ 6.0 first came out, but have not used it since VS 2003 and C# became prevalent.
Thanks for any help in advance!
Bill
Check the DoDataExchange() method. It should have the logic for writing data to or reading it from the controls. If the programmers used the default implementastion, then there will be a DDX_... macro for each control that is being read/written. Just look at any other MFC dialogs (in your code or google) to see how the DDX commands should be written if they are missing.
Alternatively, if it's only 1 or 2 values you can easily just get the control and read it directly if you don't mind doing validation etc yourself. Get the ID of the control from the form designer and use something along the lines of:
CEditWnd *pWnd = GetDlgItem(ID_THECONTROL);
CString newValue = pWnd->GetWindowText();
...
You'll need to look at the content of the DoDataExchange method and see what it is doing. There is not sufficient information here to tell what could be going wrong other than that.

Resources