Closed w3dkramer closed 2 years ago
@w3dkramer: dont_click.element
specifications must contain a tag name; they can optionally restrict the tag occurrences with under_xpath
, with_text
, or with_attribute
qualifiers. We do not support specs that contain only the qualifiers without any tag; e.g.
[[dont_click.element]]
under_xpath = //div[@id='ibm-masthead']//*
For examples, see https://github.com/konveyor/tackle-test-generator-core/blob/main/tackle-test-generator-ui/test/data/sample/tkltest_ui_clickables_config.toml#L33-L68
@sinha108 What would I do to prevent clicking on all types of tags that occur in the children of the xpath? Is it necessary to specify duplicates of
[[dont_click.element]]
tag= $X
under_xpath = //div[@id='ibm-masthead']//*
where $X = button
, input
, a
, etc.?
@w3dkramer: Currently, yes, you would have one dont_click
element for each tag. We can look into enhancing the spec to support multiple tags (e.g., tag = ["button", "input", "a"]
), which would make the spec simpler in cases where all tags have the same under_xpath
/with_text
/with_attribute
qualifier. Completely omitting the tag would be harder because the Crawljax API doesn't support specifying element qualifiers without a tag.
Understood. I can work with the spec as it is at the moment, specifying each tag individually, but would definitely be in support of the enhancement to list multiple tags. In theory maybe there could also be a way to specify tag = "all_types"
or some keyword, which the spec parser could just translate to duplicate the dont_click element for some predefined list of all types of tags to exclude. In the meantime thank you for illuminating the error.
@w3dkramer: Support for list of strings for tag_name
has been added: tag_name
can now be either a string or a list of strings.
Describe the bug
Instead of don'tClickChildrenOf, the dont_click.element specification item is being used with the under_xpath option. I wanted to exclude all children, no matter the type of tag, so I specified
and got the exception: