c# automation code - c#

I need to write C# automation script for metro app testing. I am using ranorex tool. How do I launch the application present on metro UI through the script? If I record and play back, it doesn't work on the different system. Please suggest script to launch the metro app.
I do not know the folder/path to the metro app as it is hidden.
Thanks

There is a framework called UIA provided by Microsoft for automating Windows 8 apps.
This link would give you the brief idea.

Related

How can i implement Twain in a UWP App for scanning documents

Im trying to create an UWP App that allows the users to scan documents with TWAIN. I tried a few nugets such as Atalasoft DotTwain, NTwain, TwainDotNet and Saraff.Twain. All of them have samples made in WPF, Winforms... except the Saraff.Twain nuget that have a sample made in UWP.
The problem here is that when I run the WPF and Winforms samples all of them works pretty nice, basically is what I need to do but in UWP and when I try to use the code of the samples on my own App it doesn't build because it doesn't recognize a lot of classes even with the Using sentences at the start of my class.
The Saraff.Twain UWP sample doesn't build and i can't find another Twain UWP Sample on google.
Im not putting code because there is no particular problem but if you want it just leave a comment and I'll upload some.
Does anyone have used TWAIN in an UWP APP successfully? I'm very lost with it... Hope any of you have the key to the gate. Thanks.
UWP has its own document scanner API. In addition, it is possible to use Dynamic Web TWAIN in a UWP app. Check this blog: https://www.dynamsoft.com/codepool/uwp-document-scanning-web-twain.html

UI automation with another application

I need to interact with a windows application by clicking a button in my application. More precisely: how can I write in a textbox or scroll a dropdown menu?
There are multiple ways to do this depending on what kind of application you are automating. If you are automating a WPF application I would suggesting using Microsoft UI Automation (UIA). There are some nice wrappers written around UIA like TestStack.White and FlaUI. FlaUI is the more modern of the two and supports UIAv3 using a COM wrapper. TestStack.White is built on top of a UIAv2 using the managed wrapper in the .NET Framework which is no longer supported.
If you are automating anything else besides a WPF application you can do straight PInvokes to SendMessage. I would suggest staying away from that method and using the Microsoft UIA framework since sending windows messages can get quite verbose. If you really want to go with the Win32 route I suggest using something like AutoIT to automate your application.
Lastly, you will want to download the Windows SDK and run Inspect.exe from that. Inspect.exe is the application that will allow you to see the properties you are attempting to query and the patterns that are available. Applications like AutoIT have essentially built their own Inspect.exe or reference and application call UISpy which is also in the Windows SDK but mostly superseded by Inspect.exe.

How to get element properties from Metro W8?

I'm automation test engineer and performing automation using SilkTest
Is there any way to get active Metro window elements (e.g name, style, coordinates, sub-elements)?
Latest SilkTest 13.5 version do not see Metro objects at all :(.
Could not figure out from the comments whether you are looking at options other than SilkTest. If you do then have a look at RIATest which does support Metro applications.
Stating from version 6.0 a number of features in RIATest are specifically targeted at Metro style application automation, particularly:
Ability to stay on top of Metro UI to allow you to simultaneously see your Metro application and RIATest IDE and minimize switching from Desktop to Metro screens when automating a Metro application.
Recording of actions performed on native Windows GUI elements (including Metro GUI). The recorder analyses your script code and reuses your variable names to generate cleaner recorded scripts similar to how you would hand-code an automation script.
Seamless workaround for bugs like this in Windows UI Automation implementation in Metro UI.
Disclaimer: I work for Cogitek, the RIATest company.
From the SilkTest 13.5 release notes

How to develop a App that embeds into Taskbar

I am fairly new to windows programming world. I want to develop a windows application that is embedded into TaskBar(near to system tray) and clicking that actual application should launch. Is C# & WPF are right tools for that or should i use any other programming language. Any thoughts on how it can be done is very appreciated.
You can search for "tray bar application c#" or "notifyicon application c#", there are many examples. Also here is a possible duplicate of the question
How can I make a .NET Windows Forms application that only runs in the System Tray?

How to create a driver for my application

I build 2 application one for android and one for pc
My application is to make the camera of android mobile appear inside application of C#
but I didn't use DirecShow in my application..
it's work good ..but still I have to make the application of c# which display the camera
appear as an option inside Skype and MSN which I think make this application like driver
any help to do that will be great
Thanks
I don't think you can write a windows driver in c#. Maybe you should begin reading here: Windows Driver Kit (WDK)

Categories