Need to see the instanced objects in a .net application - wpf

I'm struggling with a Wpf application, using the Apex MVVM framework.
I suspect instantiation problems.
How can I see the instanced objects in the running app?

You could for example use the Windows Debugger (WinDbg) and its !dumpheap –stat command to list the objects on the heap.
Please refer to Tess Ferrandez's blog post for more information: https://blogs.msdn.microsoft.com/tess/2005/11/25/dumpheap-stat-explained-debugging-net-leaks/

Related

Windows UI Automation tools (Visual UIAVerify, Inspect.exe) recognizes the Buttons as Pane

I am using UI Automation library - TestStack.White to automate a Windows Application, where I utilize Inspect.exe to get the UI Elements from the WinForms. I have had no issues with the Inspect.exe so far except currently I am stuck with an issue in my development machine where the tool started recognizing the "Buttons" as "Pane" and the behavior is same across Visual UIA Verify, TestStack(White). Eventually all the tests are getting failed since it couldn't identify the Buttons (returns Null).
Here's what it looks like now,
[]
Here's what it used to look and it looks in a Fresh VM,
Expected,
[]
Can someone please through some light regarding this behavior or point out what would have gone wrong here ?
Thanks in Advance !
Hmm... It looks like a bug in UIAutomationCore.dll or a target application issue. I think you can't do something with that on client side. But some workarounds are possible. It's still recognized as a class name with BUTTON inside. So it's possible to do some part of your automation with a tool that can support both UI Automation (for complicated controls like WinForms list views etc) and Win32 API (like here, when it has NativeWindowHandle and adequate ClassName).
If you can consider changing the automation tool, one of the options is pywinauto. It can use Win32 API or UI Automation under the hood by your choice. The high level API is almost the same. So you can easily switch between 2 backends for different actions (having 2 different Application objects connected to one target app instance). Getting Started Guide will bring you initial guidance for the core concept.

Cucumber.js testing without relying any web browsers(Headless or real web browsers)

I was a .net based windows application developer and being a web developer now.
For the last couple of years, I tried to follow principles of Specification by example in a project.
On the last project I was involved, our team used WPF with MVVM(Model-View-ViewModel) pattern and I tried SpecFlow for testing. (Well.. the coverage by SpecFlow was very low though cause it was not officially adopted from our team and I couldn't spend enough time on it.)
Now our team started to migrate the existing windows application to a web based application and decided to use cucumber.js as a tool for implementing 'Specification by example'.
When I was trying SpecFlow before, I made all the step definitions to test ViewModel layer instead of View and it was the only way actually. What I'm confused with cucumber.js is that most of examples demonstrate how to test features via web browsers(headless or real ones).
If the features are specifying specific ui behaviors then accessing a DOM element and evaluating its value make sense. However, as far as I learned about Specification by examples, testing under the UI layer is recommended instead of UI elements directly.
It seems like most of modern web applications have layers such as MVC, MVVM(knouckout.js) nowadays. Our web application will use Angularjs and this is my theory.
I guess it is possible to use feature files - which do not state any specific UI controls and behaviors - to test under the skin of UI layer, without relying browser support. That layer would be Model of angularjs, not ui elements.
Is this approach missing something or wrong with cucumber.js?
Please give me some insights and correct me if I'm wrong.
Thanks in advance!
Specification by example specifies requirements by giving examples from the point of view of the user. What's more representative of the user: clicking items on a web page, or directly calling code? A user won't be calling methods on your view model, so in my opinion a feature test is a much better way to test expected behaviour.

How to integrate 3 wpf application in one application?

Here am having 3 different WPFapplications and now my requirement is like i want to have only one WPF app which should be invoke the other apps pages when clicking the hyperlink..
Can anyone suggest how to do that...
I tried with one type of solution i.e. having the other three has class lib and invoke the corresponding pages using the created objects, but that is not working.
please help me
Thanks in advance.
Building a Composite Application could be the way to go here. Check out these links:
Patterns For Building Composite Applications With WPF
patterns & practices: Prism
Introduction to Composite WPF
In this pattern each application is called 'Module' and is created as a library that is loaded by a main 'Shell'. The sample in the codeproject link will give you a nice first look about it.

using silverlight for user interface only

I am planning to make a web application, using silverlight for frontend. requirement is: this frontend will be just an empty shell, and it must be language independent. it will get everything it needs to display and use from server, therefore making it language independent.
i tried to find tutorials, but there is nothing.
as far as i understand, silverlight uses xaml for all its data, so just generating it with whatever language i want shouldn't be a problem. but i don't have any silverlight experience or knowledge, so i'm not sure what is the best way to do this. for example, i don't know how will new content be generated, and what kind of structure silverlight requires.
can anyone give me some starting points?
Your requirements are rather demanding. If i can summarise:
silverlight will be the front end (or container)
you don't know what it will be showing
the content may be dynamically generated
everything, including the visual content, will be retrieved from the server
If i have misunderstood then by all means correct me or adjust your question.
Those requirements are not trivial, especially when you have no prior experience in Silverlight. Fetching data from the server is a normal behaviour in Silverlight, but fetching any generated UI content will be a slow and inefficient use of the technology platform. Silverlight is delivered via the browser, and runs on the client. If you are going to have generated UI, then you may want to consider using straight HTML instead (you can generate the contents using ASP.Net or a scripting language such as PHP). Alternatively, you can generate your required UI views from within the Silverlight app itself by either swapping in and out the appropriate pre-built piece of UI (or controls), programmatically adding new controls into the visual tree, or by loading XAML using the XamlReader class.
This answer may or may not help you much, but like i said before - put some more specific details into your question and you will get more specific answers (either add comments under your question, or post a new more specific question if you cannot edit your current one).
Edit: i have just come across this blog article from Jeff Prosise explaining the use of the INavigationContentLoader interface in Silverlight 4 to dynamically load pages from either remotely or locally. It is a detailed write-up, with a lot of code samples, it may be of use to you.
I would suggest you start at http://Silverlight.net
The "Learn" section has lots of videos that can get you started. http://www.silverlight.net/learn/

Bindind DataTable with silverlight Datagrid

I am writing an app which is to be intranet based .I am trying to use silverlight with Ado.net Just like I write my aspx pages. BUt I have not found how to connect datatable generated from my class directly to my silverlight interfaces.
ANy tut that can help me with this.
Silverlight cannot connect to a database directly, it only supports webservice access. Here are two links to get you started:
http://wildermuth.com/2009/09/29/Choosing_a_Data_Access_Layer_for_Silverlight_3
http://www.c-sharpcorner.com/uploadfile/nipuntomar/dataaccesssilverlightenabledwcfservice07152008013110am/dataaccesssilverlightenabledwcfservice.aspx
Or just google "silverlight data access" and you will get plenty of hits.
If you insist on using DataTables, you may take a look at the BindableDataGrid project which includes these.
I however strongly recommend against. A better approach for dynamic data would perhaps be to use some kind of DynamicEntity class.

Resources