So I have the following tag I want to find using Xpath:
<h1 id="label">This is the text</h1>
Normally, I would write it like this:
//h1[@id='Label' and text() = "This is the text"]
Or, if I want to extract just partion of the text, I use the following:
//h1[text()[contains(.,'text')]]
Now, I tried to look for tutorials wether you can mix both statements: so I want to have an Xpath Expression that contains both @id and contains the text "Text". Is such a thing even possible?
I tried doing this:
//h1[@id='Label' and [contains(@text,"text"])]
But that doesn't give me a propper result.