-
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
[Bug] Facing issues after Switching back to UIA3 from UIA2 using Robotframework-flaui Library (UIA3 xpaths are not getting identified) #115
Comments
Its important to know what value is defined by value pattern IsReadOnly For example: If it's different between UIA2 and UIA3 then the logic is fine and the different interfaces will allow you different operations. But probably it could be wrong interpreted by usage here. Pls show me your value pattern value from inspector by this element. Afterwards your approach for an reload library is only reloading keywords but probably an new instance will be made afterwards to switch from UIA2 and UIA3. Direct keywords from switching interface is currently not implemented. But probably a better approach from your side would be to create two FlaUILibrarys like you do. Library FlaUILibrary uia=UIA2 screenshot_on_failure=False WITH NAME UIA2 Afterwards you can decicde which interface you want to use in your test if they are different in element handling. |
Thanks for the screenshots. So the issue is that the XPath for UIA3 is not recognized and it reports that the element cannot be found. For the IS_READ_ONLY parameter the different interpretation of the logic is legitimate. Because this can happen that for the different interfaces also different accesses to the pattern can happen. As in the example. Currently I see no error on your side that the Xpath would be wrong. This is exactly the right one as in the Inspector. To narrow down the error case in the Xpath I would use the Keywords Get Childs From element. This will output all childs as elements. I would also build this iteratively on the Xpath.
Until the path is complete for UIA3. From the logs you will see all the child elements of the xpath if it can be resolved. You will also see if you are iterating over the correct XPath tree and not accidentally iterating on an element that does not belong to the expected element. |
Thanks for sharing that information. The challenge that we are facing is w.r.t the element 'X' which is a testbox. We are trying to verify IS_READ_ONLY for this element. Hence while automating the testcases, we thought of using UIA2 for verifying this element and then switch back to UIA3 mode in Flauilibrary and continue the rest of the test case. *** Settings *** (Step 2) Now the following steps works fine. (Step 3) Subsequently in the next steps if we are trying to use UIA3 [ex. UIA3.Get Property From Element] on any other element, then it fails to identify the element with the xpath(UIA3 xpath). Note: Suppose we reverse the steps 2 & 3 and execute step-3 first and then step-2 then "step-3" which is uisng UIA3 is able to identify the element without any error. I think it's better if we have a connect in official chat group Gitter to discuss more in detail. |
I think that's what we should discuss, yes. However, I currently have no internet and wait until this is fixed. After that I will get back to you. |
@Nepitwin can we connect to discuss further on this. |
The below is our exact scenario.
ISSUE Description: Actually we have a desktop application where we have two different xpaths when we are trying to identify an element through FLAUI Inspect tool in UIA2 and UIA3 Identifiers types. Hence in our case we would like to switch b/w UIA2 and UIA3 while Automating end to end scenario. Also for us IS_READ_ONLY is returning 'True' in UIA2 and 'FALSE' in UIA3. Hence we need to switch B/W UIA2 and UIA3.
==>Able to switch from UIA3 to UIA2 without no issues but we are facing issues when we are again switching back to our original UIA3. Able to switch back to UIA3 from UIA2 but our problem is UIA3 xpaths are not working in this case.
Scenario:isread only
Import Library FlaUILibrary uia=UIA3 screenshot_on_failure=True timeout=0 WITH NAME Custom
Reload Library Custom
importlib.Invalidate Caches
Custom.Attach Application By Pid 27308
#Set Test Variable ${uia1} UIA3
${uia} Custom.Get Uia Identifier
log to console ${uia}
Sleep 3s
${personalid_text} /Window/Window/Window/Window/Pane[1]/Pane/Pane/Edit[5] IS_READ_ONLY
log to console ${personalid_text}
############## We are trying to switch to UIA2 ############################
Import Library FlaUILibrary uia=UIA2 screenshot_on_failure=True timeout=0 WITH NAME UIA2
The text was updated successfully, but these errors were encountered: