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

Problem with patterns on XP under limited user rights

$
0
0

I need to automate testing scenario which tests our application running under limited user rights, but I'm having issues with patterns on Windows XP. I'm able to receive all elements as if the application was running under admin account, but for some reason not all patterns are available, for example ExpandCollapsePattern for TreeView items. GetCurrentPattern method always returns null on these elements.

The problem only occurs on XP machines and only if my automation app is running as admin and tested app under limited user (if both are running under limited user then it works properly). Any idea what might be wrong?

I'm using unmanaged UIAutomation API via UIAutomationClient interop wrapper in C#.


Reg: Select row based on index of DatagridView using automation element

$
0
0

Hi,

please help in finding how to Select row based on index of DatagridView using automation element or UIframework.

also how to find the total number of rows in the Datagrid using automation element

regards,

Gomko


Regards, Gomko

Narrator should change voice depending on content

$
0
0

Hello,

After a discussion here, I have a suggestion to make on how Narrator works (if you have a workaround, please tell me):

Let's say we have a PC configured for German language, and we're using an app providing content in English (let's say it's a technology site). We want the Narrator to speak German in general (to navigate Windows, tell us that we just hit the spacebar, that we're on the 5th out of 6 elements in a list etc). BUT, when the Narrator tries to read content of this app (not just navigating like "this app got focus" we want it to use an English voice - because that's the way the pronunciation will be understandable (try tell the German narrator voice to pronounce "burst" or "Streetwise").

So I'm suggesting a new inherited XAML property "AutomationProperties.Culture". The intended behaviour is the following:

  1. The narrator speaks with the voice chosen by the user as (s)he's navigating. When it has to announce the contents of an element having the aforementioned property set, if the current voice is at least in a matching language, nothing special happens. If not:
  2. The Narrator tries to find an installed voice matching this culture. If not, it tries at least with the language. If there's one voice installed the Narrator switches to this language (if multiple are installed, we try to preserve the sex of the Narrator), and describes the contents of this element. It switches then back to the previous language.
  3. If no appropriate voice is installed, Windows prompts the user to download an appropriate voice. There are 3 choices:
  • Yes: Windows downloads the language in the background - temporarily still speaking with the previous voice.
  • Never ask me again for that language: Obvious
  • Not Now: The Narrator won't prompt the user for further elements using this language in this app, until the app is Terminated.

What do you think? It requires some development, but the current situation makes any app providing English content to foreign people with eyesight problems almost useless, even if we spend the necessary time to make the app accessible.

This should apply to both WPF and WinRT apps...

HTML has an equivalent lang tag.


Goblin Dice Roller for your RPG games!

Automation tool

$
0
0

Hi,

I want to start with creating an automation framework for testing apps in the vehicle head unit.I am new to this and can anyone help me as of how can I start creating the tool which can be used to test different apps and automate the testing process.

Is there any tool available which can help or should i start developing one?

Also which can be the best technology used which can do this?

Please help

Magnification API - Sometimes an error occur when the MagSetWindowSource function called

$
0
0

 I am developing a capture application with Magnification API. The program is to capture of both primary and Seconday Screen. Sometimes access violation occur when MagSetWindowSource function called.


1.  The error is 

First-chance exception at 0x7fefeb257c9 in test01.exe: 0xC0000005: Access violation reading location 0x0afff660.


2. My Developing Environment is

OS : windows 7 64bits

Video : NVIDIA Geforce GT 520 , Dual Monitor(Primary 1280x1024, Secondary 1920x1080)

Application : 32bit application.

3. My test code is

if (!MagSetWindowFilterList(hwndMag, MW_FILTERMODE_EXCLUDE, 1, pFilterList))

{  return;

}

RECT sourceRect;

sourceRect.top = 0;

sourceRect.left = m_ScreenX;

sourceRect.right = m_ScreenX + m_ScreenW;

sourceRect.bottom = m_ScreenH;//m_ScreenY;

if (!MagSetWindowSource(hwndMag, sourceRect))// Access violation frequently.  The value of sourceRect is valid.

{

  return;

}

//The reference of this source is http://www.codeproject.com/Articles/607288/Screenshot-using-the-Magnification-library

Please help me. I'dont know why error occur sometimes.

Thank for reading it.



WPF Window showing up as a Win32 HwndWrapper class control

$
0
0

I have a test suite implemented using Microsoft UI Automation Framework, running on a remote machine using a test controller and test agent (2012). This machine runs Windows Server 2008.

All tests have an initializing method that starts the application and then waits for its window to come up (using a certain Name property value). The tests run just fine when I do an isolated run, but if I run the entire suite,sometimes I notice that the element search for the window is failed or takes a really long while (circa 20-30 seconds).

If I use UIAVerify, I can see that the window element exists in the visual tree -- only that instead of having a "Window" class name and a framework type of WPF, the class name is a bizarre string looking like this: "HwndWrapper{application.exe}guid", where application.exe is obviously my application, and guid is a random (as far as I can tell) guid that shows up after it. Also, the window normally has an AutomationId property associated with it, and in this case it's null. If I keep polling the visual tree, I see that eventually, after 2-3 minutes, it changes to the expected WPF window class object and gets an AutomationId property value.

It also seems that this works just fine on my Windows 7 machine - is there a known bug with Windows Server 2008's support for UIA? Or can this be performance-related? (the server is significantly weaker than my local machine)

MSFlexGrid - Problem with getting rows and cols

$
0
0

Hi,

Does anyone faced with problem to automate MSFlexGrid using UI Automation? I can not handle this control. Is there any special library which will help to handle this sort of control?

Many thanks for your reply.

CodedUI Test Builder throwing System.OverflowException: Arithmetic operation resulted to an overflow

$
0
0

CodedUI Test Builder throwing System.OverflowException: Arithmetic operation resulted to an overflow at System.IntPtr.op_Explicit(IntPtr value) while dragging crosshair on custom control on 64 bit target platform in winform application but It works fine when i changed target platform to x86.

I have tested this scenario on multiple machines with same configuration, It throws the same exception with 64 bit target platform. With Windows standard control it is not throwing any error the problem comes with custom controls only also I would like to mention that control is working fine inside my application it is not throwing any exception Only With CodedUI  with x64 target platform it is throwing exception when i drag crosshair to select custom control.


Automation of DataGrids and Tabs

$
0
0

Hi ,

I am trying to Automate Tabs and DataGrids in a 3rd Party WPF application.

When ruuning UIsPY on the controls , it seems that the CONTROL PATTERNS are empty even though Control Types are properly Identifiable.

Is it mandatory that the 3rd Party teams should make Control Property accessible to outside the application.

Magnifier API on WoW64

$
0
0

I'm working on an accessibility software which uses the Magnifier API to magnify parts of the screen. The software is compiled in win32-configuration and is supposed to work on Windows Vista/7 in 32 Bit mode and on x64 machines in WoW64-mode.

The software works fine on a 32 Bit OS, but if I run the software on a x64 machine in Wow64-mode, the magnifier shows only a black rectangle instead of the magnified area. This happens not always, but at least at 50% at the time.


To isolate the problem, I was running the magnifier example code from the Windows Sdk and I could reproduce the same behavior here. It runs fine on a 32 Bit machine, but not always in Wow64 on a x64 machine.

Then I recompiled the magnifier sample in x64 configuration and .. surprise .. it works fine on the x64 machine.

  • win32    32Bit OS                  -> works
  • win32    64Bit OS (WoW64)    -> doesn't work always
  • x64       64Bit OS                  -> works


So it seems to works in every configuration except of WoW64. I would greatly appreciate it, if there is any way to make this work in WoW64 mode (because providing a 64 Bit-compiled application would increase the complexity of the release process)


Thanks,

Martin

Need help on finding Automation Element

$
0
0

Hello All,

Iam trying to find  automation element for the particular component in Web apps developed using  ASP.Net .I could not find al the automation elements and Ids .I could see al l the properties using UIA2.0

Please go through the below code. Appreciate your help !

uSECASE 1:

public static void  getRecursiveElements(AutomationElement parent)
{
      
    AutomationElementCollection children,children1,children2;
  children = parent.FindAll(TreeScope.Descendants, Condition.TrueCondition);
  if (children != null && children.Count != 0)
      {
          for (int i = 0; i < children.Count; i++)
          {
              //AutomationElement val = children[i].Current;
              //getRecursiveElements(children[i]);
              sw.WriteLine(children[i].Current.Name);
              sw.WriteLine(children[i].Current.AutomationId);
              sw.WriteLine(children[i].Current.LocalizedControlType);
              //if (children[i].Current.Name == "Create/Edit Asset")
              //{
              children1 = children[i].FindAll(TreeScope.Descendants, Condition.TrueCondition);
              if (children1 != null && children1.Count != 0)
              {
                  for (int j = 0; j < children1.Count; j++)
                  {
                     
                      sw.WriteLine("ChildName1----->" + children1[j].Current.Name);
                      sw.WriteLine("ChildID----->" + children1[j].Current.AutomationId);
                    sw.WriteLine(children1[j].Current.LocalizedControlType);

                      children2 = children1[j].FindAll(TreeScope.Descendants, Condition.TrueCondition);

                     if (children2 != null&&children2.Count!=0)
                      {
                          for (int k = 0; k < children2.Count; k++)
                          {
                              sw.WriteLine("ChildName2----->" + children2[k].Current.Name);
                              sw.WriteLine("ChildID----->" + children2[k].Current.AutomationId);
                             sw.WriteLine(children2[k].Current.LocalizedControlType);
                          }
                      }
                  }
              }
              // }
          }
  }
      sw.Close();
}

useCase 2:

 

 

  private AutomationElement WalkControlElements1(AutomationElement rootElement)
        {
            // Conditions for the basic views of the subtree (content, control, and raw)  
            // are available as fields of TreeWalker, and one of these is used in the  
            // following code.
            AutomationElement elment = rootElement;
            AutomationElement elementNode = null;
            if (elment == null) return elementNode;
           
            // your logic for condition ( this I don’t know what to write)
            //bool val = true;
            elementNode = elment.FindFirst(TreeScope.Descendants, new PropertyCondition(AutomationElement.NameProperty, "Select Business Category Product"));

            if (elementNode != null)
            {
                ///val = true;
                return elementNode;
            }
            WalkControlElements1(TreeWalker.ControlViewWalker.GetFirstChild(elment));
            // Call for next sibling
            WalkControlElements1(TreeWalker.ControlViewWalker.GetNextSibling(elment));

            // Call for First child
           
            return elementNode;
        }

 

UIAutomation stackoverflow exception rootelement.findfirst

$
0
0

I am trying to use System.Windows.Automation to automate GUI regression testing. In the constructor of my test object, I launch the application and locate it in the tree with AutomationElement.RootElement.FindFirst, and I limit the scope of the search to children. I getting a stackoverflowexception every time I run my test just to launch the application and locate the form. Any help wold be greatly appreciated. My constructor:

<!-- language: c# -->
public GuiTest(string inFormName, string inExecutable, Dictionary<string, ControlTypes> inElements)
{
    //Start the GUI
    myProcess = Process.Start(inExecutable);

    //We have to give the application time to fire up
    int count = 0;
    do
    {
        //Get the root element of the GUI
        myParentElement = AutomationElement.RootElement.FindFirst
            (TreeScope.Children, new PropertyCondition(AutomationElement.NameProperty, inFormName));
    }while(myParentElement == null && count < 50);

    if (myParentElement == null)
    {
        throw new InvalidOperationException("Could not find form " + inFormName);
    }

    //Get the buttons and stuff
    LoadElements(inElements);    
}



UIAutomation - InvokePattern only works while Debugging - Button is not Recognized as a Button

$
0
0

I am manipulating an old program using UIAutomation. The issue I have involves pressing a button usingInvokePattern.

After pressing a button that opens up an explorer window and getting the AutomationElement for the window, I get the AutomationELement for an "Open" button, actually a SplitButton. I can find the element easily, but it comes up as a Pane control rather than a SplitButton Control. However, if I insert a breakpoint before looking for the Button element and manually step through the code in Debug mode, the "Open" button is recognized as a Button.

If I insert a breakpoint after finding the Button Element, the element Name and AutomationID are correct, but ControlType is a Pane instead of a Button. It's bizarre.

The offending code is below: (Net 3.5, VS2010, Win7 x64)

            InvokePattern bPattern = (InvokePattern)button.GetCurrentPattern(InvokePattern.Pattern);
            bPattern.Invoke();

            for (int wait = 0; wait < 50; wait++)
            {
                if (explorerWindow != null)
                    break;

                explorerWindow = reportWindow.FindFirst(TreeScope.Children,
                                                new PropertyCondition(AutomationElement.NameProperty, "Select Report"));

                Thread.Sleep(200);
            }

            explorerOpenButton = explorerWindow.FindFirst(TreeScope.Children,
                                    new PropertyCondition(AutomationElement.NameProperty, "Open"));

Lock window 7 via window service

$
0
0

Hi,  

I am trying to lock window 7 pc via a window service.  

I have been able to do so from win XP via code  

  Process.Start(@"C:\WINDOWS\system32\rundll32.exe", "user32.dll,LockWorkStation")  

 but when i trying this on Win 7 its not working.  

 Can anyone please provide me how i can lock Win 7 via window service or some alternate solution to it. 

 

System process which can't be terminate by taskmanager

$
0
0

anybody,

pls provide the list of System process which can't be terminate by taskmanager.


manisharma


Process start at boot time..

$
0
0

Hi All,

I am developing a client application which needs to be start up at boot time and there is one more requirement that no body 

should be able to delete this to provide it security.

Please reply .

Thanks

Debugging with uiAccess=true

$
0
0

My application requires uiAccess=true in manifest file and becomes digitally signed during post build event.

 

<requestedPrivilegesxmlns="urn:schemas-microsoft-com:asm.v3"><requestedExecutionLevellevel="asInvoker"uiAccess="true"/></requestedPrivileges>


When I try to run my application from the debugger with VS2008 or VS2010 I get the following error:


Error while trying to run project: Unable to start program [Application].

The application manifest has the uiAccess attribute set to 'true'.
Running an Accessibility application requires following the steps
described in Help.


[OK] [Help]


But the help button is redirecting me to a "Page not found"-Website.


Is it even possible to debug an application with uiAccess=true ?



Martin

can't find AirplaneModeSwitch in AutomationElement.RootElement

$
0
0

Hi,

my tool is for enable Airplane mode or disable it.

source is C#, as following:

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Automation; namespace Airplane { class Program { static void Main(string[] args) { GetDesktopElement(); //GetFocusedElement(); } public static void GetDesktopElement() { var NetworkCondition = new PropertyCondition(AutomationElement.AutomationIdProperty, "AirplaneModeSwitch"); var mainNetwork = AutomationElement.RootElement.FindFirst(TreeScope.Element, NetworkCondition); TogglePattern slider = (TogglePattern)mainNetwork.GetCurrentPattern(TogglePattern.Pattern); Console.WriteLine(slider.Current.ToggleState); slider.Toggle(); Console.WriteLine(slider.Current.ToggleState); } public static void GetFocusedElement() { var NetworkCondition = new PropertyCondition(AutomationElement.AutomationIdProperty, "AirplaneModeSwitch"); var mainNetwork = AutomationElement.FocusedElement.FindFirst(TreeScope.Element, NetworkCondition); TogglePattern slider = (TogglePattern)mainNetwork.GetCurrentPattern(TogglePattern.Pattern); Console.WriteLine(slider.Current.ToggleState); slider.Toggle(); Console.WriteLine(slider.Current.ToggleState); } } }

i found use GetFocusedElement() worked after execute

rundll32.exe %SystemRoot%\system32\van.dll, RunVAN


but GetDesktopElement() can't work.

due to execute "rundll32.exe %SystemRoot%\system32\van.dll, RunVAN" will open a sidebar, i want skip this step, just fetch the automation UI "airplane mode" direct.Would you help me?









windows 8 block alt-tab simulation

$
0
0

windows 7  OK

// Simulating a Alt+Tab keystroke
keybd_event(VK_MENU,0xb8,0 , 0); //Alt Press
keybd_event(VK_TAB,0x8f,0 , 0); // Tab Press
keybd_event(VK_TAB,0x8f, KEYEVENTF_KEYUP,0); // Tab Release
keybd_event(VK_MENU,0xb8,KEYEVENTF_KEYUP,0); // Alt Release

Using the same on windows 8 fail.
Tried as guest, admin and "elevated admin".

Other key combinations (special with the win key) also fail... it's not only alt-tab.

Did someone already solved this issue?

Windows - Enable Peek

$
0
0

I need a solution for my application - that works with Windows 7, 8 & 8.1. My application is primarily used in dual display systems, where it streams the content to the secondary screen (in a full screen mode) and the primary screen would be used by the PC user to continue work.

In such a scenario, when the PC user goes through the items in taskbar and mouse-overs through the thumbnails, all the windows get minimized including the video being played. This is done by the "Enable Peek" setting as per the documentation I went through. Disabling the Enable Peek functionality resolves the issue.

Is there a way to programmatically enable/disable this functionality. This would be helpful, as I don't want to disable the "Enable Peek" functionality forever. The program will disable it while streaming the video and set the user preference back when done.

Thanks,

Sreeram.

Viewing all 585 articles
Browse latest View live