ruby - Verifying searched text displayed is in a single line -
How can I test that a sentence (combination of four or five words) is displayed in a row?
I have to search with a name or some other areas after the search results are displayed, I should check whether the text displayed is a single line or not. For example, the code below is used to verify the search result link:
// ol [in (@ class, 'search result')] / li [ Contains (@ class, 'mod') result () and in it (@ class, 'XXXXXX')] / / [[[href ['href' 'trk = XXXXXX']]
I'm not familiar, but the following approach should work in any language.
Assuming that your "sentence" is completely contained in an element, you can get all the events with something like this:
driver.findElements ( By.xpath ("// * [text () = 'your sentence']"))
Then just test for the size of the array.
Comments
Post a Comment