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

Autoit click with OK button not happening with Windows 10
How much support is given by appium for automation.?
UI performance penalty when using UIAutomation
How to scroll through a UIACollectionView and click on a button?
Webview elements inspection for testing
Galen framework clarifications for automation
UI Automation: Tap on table view cell that’s off screen
UIAWindow > UIAPopover
uiautomator runs multiple tests on multiple devices?
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

Categories

HOME
qt
hpoo
openshift
android-espresso
magento2
angular-ui-grid
livecode
qc
kivy
dafny
ios-simulator
odata
header
iptables
javafx-8
scheduler
anchor
fasm
circleci
tiff
angular4
sonicwall
async-await
pygobject
mixpanel
word2vec
boomi
nullreferenceexception
spyder
weex
pst
ava
web-config-transform
introspection
crud
hdmi
tortoisehg
materialize
locks
mongodb-3.4
reporting
universal
private-key
creation
cups
installanywhere
fastlane
strapi
mars-simulator
suds
haar-classifier
contactless-smartcard
google-prediction
code-push
jshint
daz3d
rightnow-crm
intellij-lombok-plugin
hibernate-ogm
punctuation
watir-webdriver
mobile-angular-ui
haraka
logical
visual-studio-monaco
coovachilli
android-4.2-jelly-bean
maximize
mathnet
jeditable
django-validation
phpquery
textpattern
bayesglm
wso2ml
ampersand
actionpack
ipod
ocmockito
python-curses
nsmutabledata
mod-auth-openidc
nhibernate-criteria
sql-processor
flurry-analytics
berkeley-db-xml
stripe.net
jomsocial
armv6
rautomation
quickgraph
node.js-stream
rikulo
axacropdf
django-filebrowser
xalan
onconfigurationchanged
telerik-ajax
taskkill
n-queens
glx
office-automation
kext
kernel32
rtd
tabbarcontroller
fgetc
cleartype
bucket
.net-client-profile
html-generation
service-factory

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App