Skip to content

easy to use between logic to Get Text #4608

@tkopra

Description

@tkopra

Is your feature request related to a problem? Please describe.
Quite often there is a need to get subtext out of a longer text. For example order number. Currently several lines are required to do that or using some very technical and hard to understand tricks to do that in a single line.

Describe the solution you'd like
New argument "between". Value to that can be given for example ??? marking the place in text that should be returned only. For example case where full text in web page is "Order number: 12345.". Get Text text=Order number between=Order number: ???. would return "12345". Shorter between=number: ???. would do the same. If ??? is in the beginning or end, start/end part of the string is returned. In the same example case Get Text text=Order number between=Order number: ??? would return "12345."

Describe alternatives you've considered
Having this as a new assertion type. But as far as I can see other assertions do not impact the final returned value. So this is probably bad idea.

Or having this as formatter. But looks like formatters are currently tied to the assertions and cannot be given separately, nor directly to the keyword Get Text without using separate Set Assertion Formatters. So to go with this approach formatters should be decoupled from assertions and added to Get Text as new formatters argument. With maybe syntax like Get Text text=Order number formatters=between:Order number: ???. But in the end the syntax is a bit less clean and needs vary too much for generic Set Assertion Formatters type of use making sense with between.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions