-
Notifications
You must be signed in to change notification settings - Fork 12
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
FlaUI unable to identify the change in Automation ID #79
Comments
Did you refresh the flaui inspector? Because it's probably an old cache from flaui from element if you don't refresh you will not see any changes here on the inspector tool. On Robotframework side you can check it on multiple ways. By robotframework 5 IF Version
The second argument avoids an element not found exception and returns true if element could be found otherwise false. So you can write your logic code what to do here aftewards your id was changed. |
@Nepitwin , I have tried it, the framework is still not able to find the ID. Is there any way we can refresh the cache from framework also. |
All keywords from robotframework flaui will receive all gui element from user interface. So if you use some of these keywords if the id was changed the element should be accessible. Can you pls use the keyword
Here you can verify if you Button element exists from child element and which automation properties they got. It's a keyword for debugging purpose to identify xpath from childs. Only the inspector tool contains a cache implemented. To refresh by inspector tool simple use F5 the element should be updated if not the user automation id is not changed. This could be verify by Get Childs From Element keywords. |
Hi @Nepitwin , Tried using the command, with the tool I can see the change in ID, but the framework is still showing the old ID. Refer the attached screen shot, |
Thanks for the information i look into FlaUI C# Code and found that code.
My first idea is that the Flag IsCachingActive is True so your first request stores all data but does not refresh, But in your use case you want to update the change. I think i can easily reproduce it now and fix it by an adittional new keyword Disable Cache So afterwards your test can disable the caching feature and reenable it because it will be a heavy intensive operation. But for your use case you want to recognize the change. |
If you want to pre test changes you can install one of these wheel files from zip. robotframework_flaui-1.0.549rc549.zip This has now the ability to disable caching feature by Library include or by Keywords
Currently it's missing test by automation id change behavior like your mentioned. If it's implemented then this will be merged to main branch and released. |
After i write your use case that an automation id is changed by an interaction i can not reproduce your issue. I extend my wpf test application by an button Change Automation Id. If i click on it i will update the automation id property by C# Code.
Afterwards my test is quite simple
After the execution id was changed. This is tested by robotframeowrk-flaui version 2.0.1. Could it be that your test execution is too early that the automation id property does not change on your robot test? Did you use an Wait Until Keyword Succeeds? Because i think your test is that you wait for an call an service instance is changing the id if the telephone is ringing. So your test has to wait an amount of time if this signal is coming to your application. |
Hi @Nepitwin, Thanks for the support !!! My requirement is as you said it was telephony app, so if the call was triggered by someone, it will reflect in my app that particular contact is ringing, active and hold. Yes I have waited few seconds also for the ID to reflect . Tried using Disable Caching and Refresh Cache keyword, still facing the same issue. new ID not getting reflected. |
Hi @Nepitwin , Is there any way we can get the button attributes like background colour and border colour. If its there, I can validate the colours instead of ID's. |
I analyze the code from flaui and found some properties --> https://github.com/FlaUI/FlaUI/blob/master/src/FlaUI.Core/FrameworkAutomationElementBase.Properties.cs I would test it by my own if this values are the correct one and implement this feature to your response from #72 But one thing is clear if your solution will work by your changing of color codes then automation id should asweel work because these are all properties which are updated automatically by each request. Why this not working on your side i currently don't know sadly. |
Hi @Nepitwin Need a help !!! I wanted to try the same with class names. I have class property in my exe, I can see it in the developer tools. But in the FlaUI inspect tool class name is showing as not supported. Please refer the below screen shot. Please let me know what could be the issue. Have tried adding the value also, but its not showing in the tool. |
Intresting now i know which gui tool your use case is. It's not an desktop user interface element. This is quite easy to answer for you. This html5 elements are not implements with UIA3 or UIA2 interface from microsoft. https://learn.microsoft.com/en-us/windows/win32/winauto/windows-automation-api-overview I thought your application is based on a desktop application like wpf but it seems it's a hybrid application as html5 as dom tree usage. Yeah you probable see xpaths from this element on gui side but probably it's quite not supported to interact with them like your use case. Did you think to use web application based testing libraries like https://applitools.com/tutorials/quickstart/web/robot-framework https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html Which you can handle xpaths like robotframework-flaui by your dom tree. FlaUI can be used for browser related testing but it's not recommended for my opinion because it handles windows automation based elements. If you want to test it you can try UIA2 interface maybe it's supported their if not you don't have access to an automation interface implementation from windows. |
Hello, I am having a similar problem to the original poster where robotframework-flaui is not picking up a dynamically changed property on an element. It is a WPF application, but unfortunately I don't have access to the source code, so I don't know exactly how this update is done in the code. I have tried using the Wait Until Element Exist, but it does not work in this scenario. When I log the elements using Get Childs From Element, I can see that the element still has the old property (Name in this case), but the screenshot taken at the same time shows that the UI has been updated. I think a "Refresh Cache" keyword would help in this scenario to force a new scan of the UI elements. Would it be possible for you to reimplement the "Refresh Cache" keyword for the newest version of robotframework-flaui for a test? |
Hi,
Thanks for the Support !!!
I am facing issue with the FlaUI with the latest version, I have my application opened already and attaching it to FlaUI with ID.
Getting an error that,
FlaUiError: Element from XPath '//*[@AutomationId="inst1-base-Sales-ringing"]' could not be found, but still it can be found with the FlaUI inspect and the element is visible in the screen. The ID of this button changes dynamically when some actions are triggered.
PFA attached screen shot - In the FlaUI inspect in details changed ID is reflecting , but in the summary it is old ID.
The text was updated successfully, but these errors were encountered: