GDATASoftwareAG / robotframework-flaui

Windows user interface automation library for Robot-Framework. FlaUILibrary is a wrapper for the FlaUI automation library.
MIT License
58 stars 12 forks source link

[Keywords Request ] Adding some keywords which are mentioned below in our FLauiLIbrary will help. #118

Closed vamsivarma94 closed 1 year ago

vamsivarma94 commented 1 year ago

ValuePattern-IsSelected. Get Current Window Wait Until my Entire window loads Switch Between UIA2 and UIA3 Find All Elements(This should find all elements those are having similar xpath and this should return as a list. Based on requirement we can perform action in any element in that list) Close Application using Application name as of now we can only close with Application Process ID

ghost commented 1 year ago

Hi, @vamsivarma94 . As i have used FlauiLIbrary a few months (i am user too, not author), I have some ideas for your questions

  1. ValuePattern-IsSelected. Do you mean add "IS_SELECTED" into keyword "Get Property From Element". If you want to know specific type element such as RadioButton, Checkbox, you can use keyword "Get Radiobutton State", "Get Checkbox State".
  2. Get Current Window is hard to achieve. Because there has no correct property of a window can explain that the window is on top. So you should know which window is on top when it runs in which testcase step.
  3. Wait Until Entire Window Loads. I suggest you can use keyword "Wait Until Element Is Enabled" , when the last element of Window is Enabled, Window is loaded over.
  4. I did not know anything about Switch Between UIA2 and UIA3.
  5. Find All Elements. If your elements are belong to a same father element, you can use keyword "Get Childs From Element" to see does it can achieve your requirement. In current design, robotframe-flaui always returns the first one element of when all elements have similar xpath.
  6. Close Application you can use element xpath like /Window[@Name="your application name"] or /Window[contains(@Name, "you application name")]
Nepitwin commented 1 year ago

Hi,

@JimRevolutionist thanks to help.

I will analyze the requested keywords which can help you and give a feedback about it. However, Jim did a good job of describing some approaches.

I would try to implement most of the keyword for the next release as much as possible.

vamsivarma94 commented 1 year ago

@Nepitwin Thanks a lot for all your contributions and support to this library. Which is really helping us in automating all desktop related applications.

@JimRevolutionist and @Nepitwin I think we can still include few keywords in our library which will help us in utilizing this library completely.

Kindly just go through the below link of an FLAUI library wrapper which has some additional keywords which were developed as wrappers(in python) based on FLAUI DLL's. https://github.com/amruthvvkp/flaui-uiautomation-wrapper/tree/master/flaui/wrappers/core

Nepitwin commented 1 year ago

Implemented keywords from this issue

ToDos

Nepitwin commented 1 year ago

Find All Elements will be implemented to return an AutomationEntity class whcih contains AutomationId, Name, ClassName, and Xpath which contains a list from all founded elements.

But be carefully https://github.com/FlaUI/FlaUI/blob/2eb0f7cd0ec7896f5eeddd6263ffbc42f9168df9/src/FlaUI.Core/Debug.cs#L19 will be used which is an heavy Tree Walker Operation to get full Xpath from elements.

Nepitwin commented 1 year ago

Wait Until my Entire window loads keyword can not be identified if window is fully loaded.

But probably the WindowsInteractionState Property from Window can help.

This contains a ReadyForUserInteraction this could be used to idendity that the window is ready to use.

See documentation in https://gdatasoftwareag.github.io/robotframework-flaui/keywords/2.0.13.html#Window%20Interaction%20State%20Should%20Be

So keyword will not be implemented here.

Nepitwin commented 1 year ago

Implemented keywords from this issue

Not implemented

ToDos

ghost commented 1 year ago

Implemented keywords from this issue

  • [x] ValuePattern-IsSelected :should be corectly defined as SelectionItem.Pattern.IsSelected #128
  • [x] Switch Between UIA2 and UIA3 : #124
  • [x] Close Application using Application name as of now we can only close with Application Process ID : #125
  • [x] Find All Elements : #126

Not implemented

  • [x] Wait Until my Entire window loads

ToDos

  • [ ] Get Current Window
Nepitwin commented 1 year ago

Implemented keywords from this issue

Not implemented

Get current window can not be implemented because we do not have any indicator here which modal window is at front. So developers has to know which desktop ui currently is at front. On possibility to force it is to use Focus Keyword.

If advices exists for the two keywords pls reopen an new issue here. All other keywords are implemeted and can be used in future release.