-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regarding IsUserVisible and IsHitTestVisible #95
Comments
There is a general problem with visibility determination and clicking. The problem with visibility is that there are quite a few properties that affect visibility and there is no clear and simple API to get if element is actually visible, even I think we should do the following or at try to research it:
Also here are some docs on |
Another issue I have come across is when using When iterating up the view hierarchy from the I have implemented a function that iterates up the hierarchy until it hits the parent |
Pull requests are welcome! It will also help me to better understand the problem and reproduce it. It would be especially nice if you could provide a test that will fail on current master build and will work after PR is applied. |
Currently, the
IsUserVisible
function checksIsHitTestVisible
but I'm not sure it should.IsHitTestVisible
is a bit of a misnomer. It doesn't actually say anything about if the element is visible or not. It just says whether you can interact with it. It istrue
by default. Documentation here : https://msdn.microsoft.com/en-us/library/system.windows.uielement.ishittestvisible(v=vs.110).aspx#NotExistJustToMakeTheAElementVisibleWe did a few tests with removing
IsHitTestVisible
fromIsUserVisible
. It works in most cases. The only case it didn't work was a case where we generate the components in the.cs
file, rather than defining them in theXAML
file. In this case, the driver would successfully get the correct coordinates and click at that position. But somehow the element wasn't ready and nothing happened. Since the driver just clicks a position, it reported a success and the test moved on to the next step Which of course failed because our application never reacted to the click. We also tried checkingHitTestVisible
with the.attribute
command through Winium before clicking. But it reported it totrue
so that wasn't much of a help either.It was working before we removed
IsHitTestVisible
, so when we debuggedIsUserVisible
we found that theIsHitTestVisible
was set tofalse
, even though we never set it ourselves. I'm not sure why this happens. But we found a workaround by implementing retry functionality for every step of the test.So removing
IsHitTestVisible
would be the logical option, but here is still a chance that this might fail other tests. Otherwise there is no reason to use it as far as I can see. If you wanted to checkIsHitTestVisible
, you should use the.attribute()
command.The text was updated successfully, but these errors were encountered: