Hi Tatu...
I have a library that is built as PageObject ....
There are some objects that are imported at runtime... so at the start library does not have all the information about keyword available at a given time.
Keyword Current Page Should Be Page1 is doing builtin.import_library(Page1)
This library have set of keyword associated with it... also this keyword is doing something like this:
old_order = self.builtin.set_library_search_order()
new_order = (str(page),) + old_order
self.builtin.set_library_search_order(*new_order)
So at the end, you have all keywords from all pages available (this is still in progress as I'm still working on it.. It is possible that at the end there will be always only actual PageObject available)
This keyword library provides keywords for standard manual testers. I have all the library keywords described, but for manual testers it is not always easy to write some tests, and if they want to edit some step, they need (because of their nature) to run a full test from the start to the end after every change.
Even if they try to use keywords and write tests, it always ends up that they will mess up tests.
I found out that it is much better, if they can 'run keywords' at runtime.. so I started to play with something like this
(also for automation engineers it is easier to debug keywords as they write it because the app under test is a big financial application and if you need to debug something at the end you have to run a lot of steps before it. ):
def run_debug_keyword(self):
kw = None
while kw != "END":
kw = get_value_from_user("INPUT KEYWORD")
args = get_value_from_user("INPUT ARGUMENTS SEPARATED BY 4 SPACES").strip()
if not args:
self.builtin.run_keyword(kw.strip())
else:
args = args.split(" ")
self.builtin.run_keyword(kw, *args)
So they can start a test case (let test do setup for them, and start browser with specific url) and afterwards they are able to navigate to the required part of the application and run keywords at runtime just by adding the keyword they want to run to 'dialogs'.
And this is the reason I'm looking for a way to give them a select with all the available keywords right at a runtime so they only select one of them and write down arguments.
It will be great if you can not only get keywords, but maybe also docstring from them to display it.
Maybe there is another way, how to do this... to run keywords 'live' while the test is running? Just break execution and wait for 'keyword' inputs?
At the end the idea behind this is to 'save' locally all the keywords they are using (if there is no error) and let them 'record' test case 'manually'
I hope this makes sense.