manykarim / robotframework-doctestlibrary

Robot Framework DocTest library. Simple Automated Visual Document Testing.
Apache License 2.0
46 stars 20 forks source link

Using a mask when executing Get Text From Document #39

Open funtimesspray opened 2 years ago

funtimesspray commented 2 years ago

Hello, thank you for this library it's been really fun thinking of ways to leverage it. My question is would it be possible (and useful to others) to allow the use of a mask when getting text from a document?

My use case for this is say I want to get some caption text from a video stream. I've done this already and it does "work" but if there is any other text on the screen (sports scores, text from a news story, etc...) they will of course be included. Allowing the use of a mask when getting that text would help clean up the data returned from this keyword for cases like this.

If not no worries, thanks again for the work you've done, it's appreciated.

manykarim commented 2 years ago

Hey @funtimesspray , thanks a lot for your suggestion. Interesting idea.

Let's discuss the type of mask you are looking for. I have several possibilities in mind:

By the way: Just in case your goal is to do some image based steering/automation (like clicking on Texts or waiting for things to appear) also have a look at this library https://github.com/Eficode/robotframework-imagehorizonlibrary

funtimesspray commented 2 years ago

Hi @manykarim,

Thank you very much for the fast reply, to answer your question this is the type of mask I had in mind when writing this:

a coordinate/area/textPattern mask for ignoring areas, which is similar to the masks used for visual comparison

When reading about masks for visual comparisons I figured this would be perfect for this kind of request. This type of mask should be more than sufficient since it would allow the user to designate an area to ignore when looking for text to return in expected areas.

By the way: Just in case your goal is to do some image based steering/automation (like clicking on Texts or waiting for things to appear) also have a look at this library https://github.com/Eficode/robotframework-imagehorizonlibrary

This is interesting, my goal wasn't to do this kind of automation but thanks for the link 👍