ui-automation


White/UI Automation doesn't recognize the container (pane control) in tab


I'm automating the windows application. I tried to access the pane element(which has text box, combo box controls) under tab control, but it's not accessible. White returns null.
I tried other techniques like UI automation TreeWalker (Rawview, Control view, content view), but nothing helps.
refer images in below links:
https://dl.dropboxusercontent.com/u/68446125/Tab.png
https://dl.dropboxusercontent.com/u/68446125/General%20Pane.png
As in picture 1, tab control is retrieved properly by White/UI Automation, but the child element General* Pane is not returned and it's controls are not accessible (Refer pic 2 highlighted), the first accessible child element is "General* tab Item".
Strange thing is, these controls are accessible in Inspect.exe (in windows SDK). I tried following methods to retrieve controls, but General* Pane is never accessible through White/UI Automation.
var tab = Window.Get<Tab>(SearchCriteria.ByControlType(ControlType.Tab).AndByClassName("TwoPageControl")); // Tab control is retrieved properly
var pane = tab.GetElement(SearchCriteria.ByControlType(ControlType.Pane).AndByText("General*")); // this line returns NULL
var pane1 = revWindow.GetElement(SearchCriteria.ByControlType(ControlType.Pane).AndByText("General*")); // this line returns NULL
var pane2 = revWindow.Get<Panel>(SearchCriteria.ByControlType(ControlType.Pane).AndByText("General*"));// throws exception "Failed to get ControlType=pane,Name=General*,ControlType=pane"
Tried windows UI automation code as well, but no luck.
System.Windows.Automation.Condition cd1 = new AndCondition(
new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Tab),
new PropertyCondition(AutomationElement.ClassNameProperty, "TwoPageControl"));
AutomationElement a = window.FindFirst(TreeScope.Descendants, cd1); // Tab control is returned properly here
TreeWalker rawViewWalker = TreeWalker.RawViewWalker;
AutomationElement cc = rawViewWalker.GetFirstChild(a); // General * Pane is not returned, instead General* Tab item is returned, though it's not the first child.
var cd = rawViewWalker.GetNextSibling(cc); // this returns next pane element available, not General * Pane.
Please help me how to access General * Pane and it's children under tab control. Any help is much appreciated.
I had exactly the same problem with my application. I use Inspect and open source UIAVerify where Pane element was visible as children of tab element. But when i compile Verify as a .Net 4.5 project, Pane element was not seen as part of tab. It only appears when I pointed it directly. I also search for my Pane element in Descendants of main window but there was nothing. I think it has something to do with dynamically creation of that pane content (i mean there is different content when you choose different tabItem).
I think you can't get access to that element from tree point of view.
My solution was to use AutomationElement.FromPoint Method.
http://msdn.microsoft.com/en-us/library/system.windows.automation.automationelement.frompoint(v=vs.110).aspx
I also think this shoud help if you have conntact with people developing program.
Some controls on a page are not visible for MS UI Automation

Related Links

How to link multiple columns to 1 variable in Data driven automation of ranorex
Is there a WebDriver implementation for Microsoft UI Automation (UIA)?
CodedUI test - can't send plain text password into input field
Is it possible to access lock screen elements with iOS UIAutomation?
How to find Window by variable title using TestStack.White framework?
How can I Implement a dynamic timeout in Teststack White?
How to specify Contains in UI Automation PropertyCondition
Exe create for UI automation using Teststack.white does not run when scheduled using Windows Task scheduler
White/UI Automation doesn't recognize the container (pane control) in tab
How to get descendants of a panel in teststack.white
Microsoft UI Automation: Invoke Pattern Exception
System.Windows.Forms.ListView Check box is not recognized by UIA verrify
UISearchDisplayController and UIAutomation
Handle UI Automation Mouse and Keyboard events
Add CodedUI to Test Manager
UI Automation + Mechanic.js: selector issue

Categories

HOME
orientdb
android-espresso
magento2
firebase
mpdf
yii
d3.js
long-integer
couchdb
semantic-web
consul
elisp
google-sheets-query
firebase-dynamic-links
tweepy
sharepoint-online
roku
mutation-testing
stack-overflow
nsstring
sap-fiori
mailgun
user-defined-types
susy-sass
cloudsim
renderscript
conda
channel
sipp
nurbs
fusetools
android-cardview
echosign
marquee
unmarshalling
rust-cargo
knights-tour
overwrite
fastlane
widestring
distributed-caching
jshint
daz3d
common-table-expression
absolute
tinyioc
roracle
libreoffice-writer
brightscript
redisson
solr-query-syntax
gtk#
freshdesk
wikimapia
oid
gapi
xcode6.4
pyaudio
eclemma
bbc-micro
verisign
diawi
python-cffi
html.actionlink
http.client
ambiguity
calcite
ngcordova
android-handler
quercus
rfc5545
r.java-file
baseadapter
fat32
hp-idol-ondemand
flurry-analytics
oracle-adf-mobile
aho-corasick
treeline
forio-contour
code39
pbkdf2
boinc
acceptance-testing
examine
getproperty
taskkill
prefuse
glx
kernel32
fragment-identifier
chunking
pinax
asdoc
dm
data-retrieval
external-sorting
accumulator
ntruencrypt

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App