Quantcast
Channel: Windows Desktop Development for Accessibility and Automation forum
Viewing all 585 articles
Browse latest View live

Running UI Automaiton in MIcrosoft .Net Framework 2.0

$
0
0

HI,

Can by some way, we can Automate using UI Automation in Framework 2.0?

Regards


AutomationID property is inconsistently populated between System.Windows.Automation and IUIAutomation (COM based lib)

$
0
0

I've been playing around with UI automation. I would like to be able to detect when specific textboxes which are present inside a web page, opened in Internet Explorer.

I've noticed that using the managed libraries for this do not perform in the same as the COM libraries do.

Here, I've made two examples that demonstrate the problem:

Working one, will provide "AutomationId" property value of my edit field:

static void Main_COM(string[] args)
        {

            //Automation reference.
            IUIAutomation automation = new CUIAutomation();


            //Desktop Element reference.
            IUIAutomationElement desktop = automation.GetRootElement();

            // Get the IE "Frame Tab" elements.
            IUIAutomationCondition processIdCondition = automation.CreatePropertyCondition(AutomationElement.ProcessIdProperty.Id, 8948);
            IUIAutomationCondition frameTabClassNameCondition = automation.CreatePropertyCondition(AutomationElement.ClassNameProperty.Id, "Frame Tab");
            IUIAutomationCondition tabFramesCondition = automation.CreateAndCondition(processIdCondition, frameTabClassNameCondition);

            IUIAutomationElementArray frameElements = desktop.FindAll(interop.UIAutomationCore.TreeScope.TreeScope_Subtree, tabFramesCondition);

            //get the first Frame Tab element found.
            IUIAutomationElement frameTabElement = frameElements.GetElement(0);



            //get the first IE Server Pane element found.
            IUIAutomationCondition ieServerClassNameCondition = automation.CreatePropertyCondition(AutomationElement.ClassNameProperty.Id, "Internet Explorer_Server");
            IUIAutomationTreeWalker ieServerClassNameWalker = automation.CreateTreeWalker(ieServerClassNameCondition);
            IUIAutomationElement ieServerElement = ieServerClassNameWalker.GetFirstChildElement(frameTabElement);




            //Locate all the edit fields contain in the ieServerElement.
            IUIAutomationCondition editControlCondition = automation.CreatePropertyCondition(AutomationElement.ControlTypeProperty.Id, ControlType.Edit.Id);
            IUIAutomationTreeWalker EditWalker = automation.CreateTreeWalker(editControlCondition);

            //get the first edit field from the results.
            IUIAutomationElement editControl = EditWalker.GetFirstChildElement(ieServerElement);



            //Obtain the AutomationID and ValuePattern.Value of the Edit field.
            String value = editControl.GetCurrentPropertyValue(ValuePattern.ValueProperty.Id) as String;
            String id = editControl.CurrentAutomationId;


            //Write the ID and value to the Console window.
            Console.WriteLine(String.Format("{0} = {1}", id, value));

        }

Now, if I do pretty much the exact same thing using the managed classes (using the code below) the "AutomationId" property is NEVER populated. I've tried several different ways about getting to my edit field, but nothing I try allows me to access the AutomationId via Managed UI Automation library, the COM version works flawlessly.

static void Main_managed(string[] args)
        {

            //Desktop Element reference.
            AutomationElement desktop = AutomationElement.RootElement;


            // Get the IE "Frame Tab" elements.
            Condition processIdCondition = new PropertyCondition(AutomationElement.ProcessIdProperty, 8948);
            Condition frameTabClassNameCondition = new PropertyCondition(AutomationElement.ClassNameProperty, "Frame Tab");
            Condition tabFramesCondition = new AndCondition(processIdCondition, frameTabClassNameCondition);

            AutomationElementCollection frameElements = desktop.FindAll(System.Windows.Automation.TreeScope.Subtree, tabFramesCondition);

            //get the first Frame Tab element found.
            AutomationElement frameTabElement = frameElements[0];



            //get the first IE Server Pane element found.
            Condition ieServerClassNameCondition = new PropertyCondition(AutomationElement.ClassNameProperty, "Internet Explorer_Server");
            TreeWalker ieServerClassNameWalker = new TreeWalker(ieServerClassNameCondition);
            AutomationElement ieServerElement = ieServerClassNameWalker.GetFirstChild(frameTabElement);


            //Locate all the edit fields contain in the ieServerElement.
            Condition editControlCondition = new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Edit);
            TreeWalker EditWalker = new TreeWalker(editControlCondition);


            //get the first edit field from the results.
            AutomationElement editControl = EditWalker.GetFirstChild(ieServerElement);


            //Obtain the AutomationID and ValuePattern.Value of the Edit field.
            String value = editControl.GetCurrentPropertyValue(ValuePattern.ValueProperty) as String;
            String id = editControl.Current.AutomationId;


            //Write the ID and value to the Console window.
            Console.WriteLine(String.Format("{0} = {1}", id, value));

        }

This smells like a bug? anyone know of a workaround for this, which is not using the COM interop libraries?

C#: detect when a process starts other processes

$
0
0

I am trying to find a way to get a callback in C# when any new user process starts on the machine. For example, if I opened a Word document from Outlook, I'd like to get a callback and decipher that the Word document was opened by Outlook. Similarly, if I click a link in a Word document which opens a web browser, I'd like to know that web browser was opened by Word document.

I have investigated the parent process idea and in some cases, this works. For example, if I start Word from the taskbar I can decipher that Word was started by Explorer. If I open a PDF from Outlook, I can tell that Adobe Reader was started by Outlook. However, if I click on a link in an e-mail, a new process is created in Chrome to handle this (one process per tab), but all it tells me via getting the processes parent is that Chrome was started by Chrome.

There are also further problems that other browsers such as Mozilla Firefox and Internet Explorer (unless you don't alter the settings), don't have one process per tab. Instead they only have one in total. In this case, the best I could hope for would be to be able to access information relating to whatever opened the first tab when the process was first started.

I was wondering if anybody knew a way round this? My thinking is that the Operating System must do something when these events happen. For example, clicking a link in an e-mail must alert the OS to find the default web browser somehow? Similarly with clicking a PDF in Outlook, the OS must detect this and go and find the default program for PDFs.

If anyone has any ideas how I can find out this information in C# I would be very grateful.

Summary: I'd like a callback each time a new application window or tab is opened along with what application window/process asked for this program to be opened.

Many thanks in advance for your help.

Creating a desktop shortcut for Internet Explorer on Windows 8.1.

$
0
0

How can I put a desktop shortcut for Internet Explorer on Windows 8.1?

Thanks!

Dan

Creating a desktop shortcut for Internet Explorer on Windows 8.1.

$
0
0

How can I put a desktop shortcut for Internet Explorer on Windows 8.1?

Thanks!

Dan

File Open Dialog + Server Files

$
0
0

I have a windows desktop application written using MFC.

I would like to populate the files available in the linux server using CFileOpenDialog.

I know the host name. How to do this? 

UI Automation for Custom WPF Control that hosts Windows Forms Host

$
0
0
I have a custom WPF control based on ContentControl. The control displays power grid, and does its own drawing. I'd like to have elements of power grid available through automation framework.
The tricky part is that the control itself has multiple ways to draw power grid. It can draw it using WPF, or it can draw it using DirectX. When it's using DirectX (preferred mode), the control hosts
WindowsFormsHost and randers on its HWND.

Now I have implemented Automation Peer on my Custom control, and elements all show nicely in Inspect (very cool).
But the problem comes when trying to simulate a click through automation framework. AutomationElement.FromPoint always returns the windowsformshost automation element instead of my custom automation element.

When I look at Automation Tree it looks like this

Window
   pane   <- Windows forms host
      pane
   Titlebar
   Custom Control <- My Custom control that displays power grid
       Power grid elements
      
I suppose the issue is that pane comes before my custom control, and automation framework belives that it is covering my elements.
How do I work around this? Can I somehow tell Windows Forms Host not to add itself to automation tree? Or to be below my custom control?

RawViewWalker.GetNextSiblingElement is delaying for 60 second on last sibling

$
0
0

I'm running Windows 10 build 10162 and calling the CUIAutomationClass.RawViewWalker.GetNextSiblingElement. When it hits the last sibling it's delaying for 60 second. It's like there is a 1 minute timeout and it's always timing out.

The Visual UI Automation Verify (UIAccess) application has the same issue and also displays an error after refreshing the tree.

Who can I contact about verifying this?


Grid Automation

$
0
0

Does anyone have any suggestions on how to find and automate a control that does not show up in UI Spy.

 

I am trying to write some automation software using Microsofts UIAutomation class. The program I am trying to automate contains a Rogue Wave Software stingray grid and I cannot get any access to it.  I cannot see it using UISpy or Spy++.  Does anyone have any suggestions on how to automate this grid.

Tab page and button drop:

$
0
0

IS IT POSSIBLE TO GIVE EVENT FOR TAB PAGE IN WINDOWS C# ?

AND ALSO DROP MENU , IF I PLACE MOUSE ON BUTTON ?

THANKS AND REGARDS,

HARISHANKAR.D

Start Child Process with UAC

$
0
0

I have 2 processes in Program Files (x86). Process 1 starts Process 2 via System.IO.Process.Start in C#. The UAC is enabled and I am running as "standard user" (although results are the same when logged in as admin). I am testing this scenario using 2 simple console applications. Process 1 simply starts process 2 and process 2 just has ReadKey() to keep it alive. Hence there is nothing in the applications that require administrative privileges or accesses system resources.

When process 1 is started from a desktop shortcut, process 2 is started as expected.

When process 1 is started from a batch file, process 2 is never started. If I add a manifest or change the startinfo to shell and "runas" then the UAC prompt shows and Process 2 starts.

However I do not want the UAC elevation prompt.

How is the security different for a batch file (command line) vs shortcut? What is the proper way to start a child process that does not need admin and does not invoke the UAC elevation prompt?

brigtness

$
0
0

i just came here knowing that somebody who can do really help solve this unknown problem...

i have the slidebar at power options but it does not effect brigtness.

changed all power plans does not effect brigtness.

updated driver chipset from hp website does not effect brigtness.

fn hotkeys does not effect brigtness.

model no hp1502tu.windows 7 home edition (32-bit)

is there anybody out there.my father just had CATARACT operation and i need to CHANGE THIS .HELP ME


anku

[UWP][Accessibilty] Is there a way to hide a TextBlock from a screen reader when doing UI Automation (or ARIA)?

$
0
0
I am using AccChecker to verify my UWP (Windows 10 universal) app. I have some TextBlocks that are using the Segoe MDL2 Assets font to display glyphs.  These TextBlocks appear in the UIA Screen reader tab of AccChecker.  Is there any way to prevent UI Automation from finding these TextBlocks?  I have tried setting AutomationProperties.Id and AutomationProperties.Name to empty strings.

batch file for copy folder

$
0
0

Hello

I need The code for a batch file

copy folder (my folder name is = my username client on the network  .for example may user name is user1 So  my folder ind drive D is User1) from one drive to another Drive copy.

I've tested this code, but did not answer.

MD D:\bdc94
attrib -r -h -s D:\bdc94\*.*
xcopy  d:\%username%\*.* d:\bdc94 /Q /Y /R /S

tanks


C#, UIAutomationClient, Getting access to a buttons background color to verify the value

$
0
0
I am using the latest C# and currently testing against a WPF app. There is a button control on the display that I need to verify the background color on. How do I do that using UIAutomationClient? Also, how would I access the same for a window background?

windows narrator and visula ui automation verify issue

$
0
0

When i look for sub windows of a particular app using Visual UIAutomation Verify it doesn't show the sub windows but when i use windows narrator to read the app's main window-name then only Visual UIAutomation Verify shows the child windows. Why is this happening?

Using UIAutomation via COM (Interop.UIAutomationClient.dll) causes Windows Explorer to crash

$
0
0

We have recently moved from using the managed UIAutomation libraries in favor of the UIAComWrapper project which wraps the functionality in the Interop.AutomationClient.dll so that we could maintain our namespaces across our project that uses UIAutomation extensively. Since then, we have had reports of random windows explorer crashes and were able to narrow down the cause and reliably reproduce the issue. This issue does not occur while using the managed UIAutomationClient, however since that is no longer being developed we would much rather take advantage of the native API as it has shown us better results, aside from this crash. See the sample code at the bottom of this post as well as a link to the UIAComWrapper project source code on git hub.

Registering for StructureChangedEvents on the RootElement, with the TreeScope of Children will cause Windows Explorer to crash intermittently. I have been able to reliably cause a crash by either navigating between network drives in Windows Explorer, or more reliably by right clicking the desktop -> Personalize -> Desktop Background and clicking the drop down "Picture Position". The crash occurs at the same location every time no matter how it is reproduced in Windows Explorer, in DUI70.dll, with the same offset every time, with an exception code C0000005. When attached to Explorer.exe in visual studio, I was able to download the public symbols for DUI70.dll and when the exception occured the function that DUI70.dll was currently executing was"RaiseStructureChangeEvent". I was only able to view function headers and the rest of disassembly. 

Is anyone else able to reproduce this and have some insight as to what may be causing it? 

UIAComWrapperhttps://github.com/JakeGinnivan/UIAComWrapper

 


user

$
0
0
I am trying to download a program and I keep getting a window that says ---another download manager currently working please try again later. this is going on now for 6 hours is there a way to correct this problem ----running windows 10 right now ---please help email addy is

Missing 8.1 features in Windows 10. How do I locate them?

$
0
0
 Windows 8.1 had a feature that I absolutely loved. Many users found it annoying, but I quickly adapted to using it. And now I can't access it. If it was removed, then Microsoft needs to return it as a feature that we must turn on to activate it (no not to confuse users).

 I'm talking talking, of course, about the Charms Bar that once swiped in from the right side of the screen if we hovered our mouse in the area long enough. It provided many useful features at a glance. Now that Windows has Cortana, we don't need the Charms Bar's search feature. But everything else is still needed. I used it often when setting up different monitors, as I traveled) for checking WiFi, PC Settings, etc. I would greatly see it return. I feel nude without it.

 Desktop Backgrounds
 I'm loving the new virtual desktops that Windows 10 brings to the table. But there seems to be missing features from it. That or I just can't locate them. The most important, for me, would bethe ability to set different background images for each desktop. As a artist, I would find it very useful to be able to set up a reference image as the background for one desktop while I work on another. Granted, I could just open the file in the viewer, but then I run the risk of accidentally closing it while I move around other images. I'm thinking it'll be a simple matter to set up the backgrounds as we would different monitors. Under Personalizations, allow a Right-Click over a image and assign it to a Desktop of our choice. It would also be nice to be able to Span images to that of the Different Desktops.

 The other needed feature is the ability to quickly switch between the different Desktops via a HotKey command. Maybe Alt+Shift+Tab or Shift+Tab. Those commands don't seem to be used for anything.

How to launch a metro app from a desktop app in windows 10

$
0
0

In windows 8/8.1,  i was able to launch a metro app from desktop app using ApplicationActivationManager and AppUserModelId.

But in windows 10, AppUserModelId value has been removed from registry under following key:

HKEY_CLASSES_ROOT\ActivatableClasses\Package, where windows 8 used to store packages and under them you could find AppUserModelId for that package

So i can't get appUserModelID for most of the apps and hence can't launch them.

Can anyone please tell me how to launch metro app in windows 10 from a desktop app.

Viewing all 585 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>