I want to pitch a idea for my new software.
If you're serious reply, then we can discuss it.
Hint: Drivers lessons
I want to pitch a idea for my new software.
If you're serious reply, then we can discuss it.
Hint: Drivers lessons
This issue doesn't happen with all applications, but consistently happen with NotePad.
For example, in UISpy, it shows the control Type is controlType.document. Text control pattern is listed there and value control pattern isn't available.
Somehow in my code ( C++ unmanaged), the control Type is shown as edit. Value pattern is available and text pattern isn't. The text retrieved from the value pattern is correct and consistent with which is shown in UISpy. I also verified AutomationID and it's correct, the same as shown in UISpy.
This issue doesn't happen in WordPad, MS office word. It works fine with tchem.
Here is some sample code :
the code to check controlTypeID
intresult = 0;
CONTROLTYPEID controlTypeId;
HRESULT hr;
hr = pt.get_CurrentControlType(&controlTypeId);
if(SUCCEEDED(hr))
{
if(NULL != controlTypeId)
{
and the code where I tried to check which control patterns are available.
void
getEditInfo(IUIAutomationElement* pParent, wstring &textContent)
{
if(pParent == NULL)
return;
BOOL isPassword =
false;
HRESULT hr = pParent->get_CurrentIsPassword(&isPassword);
if( SUCCEEDED(hr) && isPassword) {
textContent.append(L
"isPassWord: Yes\n");
std::wcout << L
"isPassWord: Yes\n";
}
AutomationManager *mgr = AutomationManager::getInstance();
IUIAutomation* pAutomation =mgr->getAutomation();
IUIAutomationTextPattern* pTextPattern=NULL;
IUIAutomationValuePattern* pValuePattern=NULL;
IUIAutomationRangeValuePattern* pRangeValuePattern=NULL;
boolisTextPatternAvailable = isPatternAvailable(pParent,UIA_IsTextPatternAvailablePropertyId);
boolisValuePatternAvailable = isPatternAvailable(pParent,UIA_IsValuePatternAvailablePropertyId);
//bool isSpreadsheetPatternAvailable = isPatternAvailable(pParent,UIA_IsSpreadsheetPatternAvailablePropertyId);
//bool isTextChildPatternAvailable = isPatternAvailable(pParent, UIA_IsTextChildPatternAvailablePropertyId);
FLOG(logDEBUG) <<
"TextPattern available : "<< ( isTextPatternAvailable? " Yes ":" No ") ;
FLOG(logDEBUG) <<
"ValuePattern available : "<< ( isValuePatternAvailable? " Yes ":" No ") ;
hr = pParent->GetCurrentPatternAs(UIA_TextPatternId, IID_IUIAutomationTextPattern, (
void**)&pTextPattern);
if( SUCCEEDED(hr) && pTextPattern != NULL) {
FLOG(logDEBUG) <<
"GetCurrentPatternAs IUIAutomationTextPattern succeeded";
getEditInfoFromTextPattern(pTextPattern, textContent);
}
else{
hr = pParent->GetCurrentPatternAs(UIA_ValuePatternId, IID_IUIAutomationValuePattern, (
void**)&pValuePattern);
if( SUCCEEDED(hr) && pValuePattern != NULL) {
BSTR tmpBstr;
HRESULT hr = pValuePattern->get_CurrentValue(&tmpBstr);
if(SUCCEEDED(hr)) {
std::wstring ws(tmpBstr, SysStringLen(tmpBstr));
std::string s;
s.assign(ws.begin(), ws.end());
FLOG(logDEBUG) <<
"Retrieved text from IUIAutomationValuePattern : ***"<< s << "***";
for(inti=0; i<ws.length(); ++i) {
if( ws[i] =='\n')
ws.erase(i,1);
}
textContent.append(L
"fontName: N/A\n");
textContent.append(L
"textContent:"+ws + L"\n");
std::wcout << ws;
SysFreeString(tmpBstr);
tmpBstr = NULL;
}
}
else{
hr = pParent->GetCurrentPatternAs(UIA_RangeValuePatternId, IID_IUIAutomationRangeValuePattern, (
void**)&pRangeValuePattern);
if( SUCCEEDED(hr) && pRangeValuePattern != NULL) {
doubletmpval;
HRESULT hr = pRangeValuePattern->get_CurrentValue(&tmpval);
if(SUCCEEDED(hr)) {
std::wstring ws = std::to_wstring((
longdouble)tmpval);
textContent.append(L
"fontName: N/A\n");
textContent.append(L
"textContent:"+ws + L"\n");
std::wcout << ws;
}
}
}
}
cleanup :
if(pTextPattern!=NULL) pTextPattern->Release();
if(pValuePattern!=NULL) pValuePattern->Release();
if(pRangeValuePattern!=NULL) pRangeValuePattern->Release();
}
Thanks a lot!
Hi there,
for a new project I would need the exact word that lies under the current cursor position.Its quite easy to accomplish this with jQuerry within a browser but I need to do this system wide. As far as I know this is not possible with MSAA or UIA because it will only give you the whole text, but not the word.
Is there any possibility to achieve this or might it also be achievable with MSAA/UIA?
Thanks in advance,
Rambazamba
Hello,
I'm working on using UIAutomation on a Flash app. Trying to get the UI objects from outside of a flash app that runs in a browsers.
Everything is working fine. In other words, I find all the objects when I run the code below from my c# program.
The problem is when I try to run it a second or third time. In other words I try to get the objects a second or third time using the code below.
Most of the time on the second or third try of getting the objects the code returns zero objects. It always work on the first try though.
Anyone have any thougts on anything I should try. It's a very frustrating problem.
Things I have already tried
Tried running it in separate thread.
Tried running the code outside of debug
Nothing seems to work.
Condition conditions = new AndCondition(
new PropertyCondition(AutomationElement.IsEnabledProperty, true),
new PropertyCondition(AutomationElement.IsOffscreenProperty,
false)
);
AutomationElementCollection elementCollection =
RootElement.FindAll(TreeScope.Children, conditions);
If anyone has any thoughts or ideas I would really appreciated it.
Thanks in advance
Allen
I Use Visual Studio 2010 to create costume Desktop application (in vb.net) for Small businesses, i use sql server 2008 for Database.I follow following steps
1. create setup of my application(xxx.msi)
2.go to client system install sql server 2008,and attach database there
3. then install application on client system
Now im getting some good opportunity to grow ,and i want my application to be more professional and up to industry standards
So, how can i crate my setup which attach database/create Database in Client's System during installation?
i have Tried http://msdn.microsoft.com/en-
I have a client who is blind and is working for an international company. He was very successfully doing his job as a system administrator until the company started to update their software. MS System Center 2012 has many, many unlabeled buttons and there are areas on the screen that he cannot move to because of lack of mouse interface. They will soon be updating to Microsoft Server 2012, which is written in Flash which is totally inaccessible to any screen reader. What can Microsoft do about this?
Hello,
I use the Reflection to subscribe the events from PowerPoint as below:
EventInfo eInfo = m_powerPoint.GetEvent(_eventName); if (eInfo != null) { Type handlerType = eInfo.EventHandlerType; MethodInfo method = this.GetType().GetMethod(_funcName, BindingFlags.NonPublic | BindingFlags.Instance); Delegate handler = Delegate.CreateDelegate(eInfo.EventHandlerType, this, method); eInfo.AddEventHandler(m_PowerPointObject, handler); return handler; }
It is working fine, however, I am facing the problem that I can not catch the Close event from PowerPoint, then I do not release by calling eInfo.RemoveEventHandler(m_PowerPointObject, _handler);.
That's why the PowerPoint could not be shutdown.
Does anyone know how we can trap the close event?
Thanks.
Hi,
I'm trying to add server-side accessibility to a control and because of that I implemented IRawElementProviderSimple and handed it out during WM_GETOBJECT. So far so good, narrator is now able to read the control's content.
However, during the lifetime of the application, controls get created and destroyed. But nearly all the time the reference count of my IRawElementProviderSimple implementation does not reach zero, the object doesn't get destroyed. Memory consumption increases
significantly over the time.
Is there a way to tell the automation client that the control got destroyed and that outstanding references to it should be released? How do I get rid of all these zombie objects?
My environment is Win7 x64, the client is narrator. In order for you to see what I am talking about I modified the "simpleuiaprovider" sample coming with the Windows 7 SDK to destroy/create a new COLORBUTTON every 5 seconds. Start the application under the debugger and keep an eye on the output window (or use DebugView). The test project can be found here: http://www.tbkoenig.de/temp/uiasimpleprovider.zip
Thanks,
Rene
I am looking for a way to automate my calendar control.I am able to identify the control / Automation element.Now, i need to select a date in the calendar.I would appreciate if get code example.
Thanks,
Aarif
Hi,
I'm attempting to grab a particular control using UI automation. The Inspect Object tools shows the control in the appropriate tree, and I can even navigate to it and have it be highlighted, but my code can't see it. Here's the code (where 'root' is the parent of the control):
System.Windows.Automation.
Condition elementPropCondition = newPropertyCondition(AutomationElement.AutomationIdProperty, id, PropertyConditionFlags
.IgnoreCase);
AutomationElement theElement = root.FindFirst((TreeScope.Element | TreeScope.Descendants), elementPropCondition);
Any ideas?
Hello all,
I have an application need to retrieve the control information base on calling AccessibleObjectFromPoint. However, when I call this API, sometimes the targeted application is hung if the point is the center point of window, but if I set another point, then targeted application is not hung at all.
Does anyone know why some application hangs when I call this API? And how can we avoid hanging issue?
Thanks.
Dear Folks.
I am pretty new to, "GUI Test Automation”, hence, seek your help at this juncture. At the moment, I am being asked to write a utility that will:
So far ,I have been able to automate many controls using White Automation framework which is a layer above Microsoft UI Automation.However,I am not able to find support for all the other controls,e.g.
-Month Calendar
-Tab
Well now ,I think of using Microsoft UI Automation for automating rest of the controls. There are couple of queries popping up in my mind which i need to confirm from experts.
Firstly, Am I right when i think in this direction?
Secondly, I feel a requirement to use both White and Microsoft UI automation so that any one of the two can provide me a solution for a particular control. Could anybody please suggest any pattern, that can assist me utilizing both efficiently.
Here is what I am trying to achieve (I appreciate your suggestions in this regard)
However i have to do this for all the controls
Thanks,Aarif
I work for team trying to extend our automated test capability, and we're leveraging the Microsoft accessibility libraries. We use the native Windows UIA libraries (http://msdn.microsoft.com/en-us/library/windows/desktop/ee671215%28v=vs.85%29.aspx), but have encountered some issues.
One of the issues is that the Window Pattern Method (WaitForWindowIdle()) always throws an exception, yet the page seems to indicate that it should be fully supported. The Exception method thrown always has the message:
"The method or operation is not implemented"
In my code, I check to make sure that the automation element supports the window pattern prior to retrieving the window pattern and calling this method.
If the window is idle and ready for input, then calling WaitForInputIdle() will throw the exception immediately.
If the window is busy, then it will actually block the calling thread until the application becomes ready, then throws the exception.
I've been running this with .Net 4.0 Framework and on a Windows 7 platform. I assumed it would be fully supported.
If anyone has been able to use this method properly and not get these exceptions, I'd much appreciate it if they could please share how they went about it. I don't have problems with most of the other patterns and methods.
TIA,
Jason
Hi all,
For out automated UI testing, we originally started using the managed UIA libraries, and found them to be quite fast and reliable, however certain UI elements implemented with legacy properties would not have those properties accessible via the managed UIA libraries.
So we switched to using the unmanaged UIA libraries, but we have now encountered a new problem, when there are a large number of UI elements, the FindFirst() and FindAll() calls will throw an exception, even though the the searchCondition we're providing should only return a single match.
In our test environment, one of the screen is a large pharmaceutical drug list table, and that provides a datagrid with around 16,500 items in that part of the UI tree. From my initial observations, it will happen with even less elements even around 8,000 UI elements.
We're using relative references (i.e. getting the IUIAutomationElement reference to the UI element just below the table, and doing the FindFirst() from there) but the exception still occurs.
The frustrating thing is that the managed UIA libraries can handle this fine, but they cause problems where we can't do a number of things such as setValue() from the Value Pattern, and we can't read legacy properties.
Is there any help, update, or fix, to get around the limitation of the unmanaged UIA libraries?
Narrator is skipping my ItemsControl in the below XAML.I can swipe to the ReviewsButton, but subsequent swipe skips over all the items in the itemscontrol. Tapping on the itemscontrol results in Narrator saying nothing.
I have overridden PrepareContainerForItemOverride and can trace into it to see that it is triggering and setting the name for all items in the control. But, Narrator still fails for this control.
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Button Style="{StaticResource ReviewsButtonWithArrowAndCountStyle}" Click="ReviewHeader_Click"
Visibility="{Binding AppState.IsNetworkConnected, Converter={StaticResource BooleanToVisibilityConverter}}" x:Uid="ReviewsButton" TabIndex="7"/>
<controls:AccessibleItemsControl x:Name="_reviewItems" Margin="20,0,0,0" Grid.Row="1"
ItemsSource="{Binding Reviews}" Visibility="{Binding AppState.IsNetworkConnected, Converter={StaticResource BooleanToVisibilityConverter}}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding
Review}" MaxHeight="50" TextTrimming="WordEllipsis" TextWrapping="Wrap" Foreground="#231F20" FontFamily="{StaticResource MundoSans}" FontSize="14.67" LineHeight="25" Margin="0,0,0,25"
/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</controls:AccessibleItemsControl>
</Grid>
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
{
base.PrepareContainerForItemOverride(element, item);
if (item is ICustomerReview)
{
ICustomerReview review = item as ICustomerReview;
AutomationProperties.SetName(element, string.Format(App.Strings.GetString("ProductDetail_RatingAndReview"), review.Rating, review.Name, review.DateReviewed,
review.Title, review.Review));
}
}
I overrode OnCreateAutomationPeer and created a new class AccessibleItemsControlAutomationPeer, derived from ItemsControlAutomationPeer... AccessibleItemsControlAutomationPeer.IsContentElementCore never gets called.
protected override Windows.UI.Xaml.Automation.Peers.AutomationPeer OnCreateAutomationPeer()
{
return new AccessibleItemsControlAutomationPeer(this);
}