This repository has been archived by the owner on Jun 1, 2022. It is now read-only.
Added the current search context frame as field to WebElementDefinition,... #30
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
... so that it can be accessed in templates.
Hi Dmytro,
as you suggested in the google group, i submit this pull request (i was Horst there). Please check if you would be ok with this addition. Feel free to change anything ;)
I'll quote myself on this:
"I started doing a modification myself and added the Frame to the WebElementDefinition class (i had to use a new class [SimpleFrame], because i ran into a cycle at serialization). When an element is created, i simply fill the frame with that one, that is selected in the tool as search context. This should work in general, because you can only detect elements in the frame that you have selected anyway.
The reason i do this is because i need to access the frame in my template for code generation. I'm going for a class in my test code, that gets a locator and the containing frame (as string) - this way, the element will be able to switch into that frame automatically when an action is called, so that i can ignore the whole frame issue (i'll add a decorator that does the switching)."
This comes from project experience, where it is annoying to constantly switch between frames. I concluded it would be best, to let this be done by a WebElement Wrapper Class.
I commited from this branch, because the master was not building for me with an indiscernable error saying only "the file contains damaged data".
Best Wishes,
Rongo