Pregunta

How can I get the text from a simple html tag

<h2>ABCDEF</h2>

using Selenium RC?

I want to match the exact text. If I use isTextPresent() it returns true even if I put selenium.isTextPresent("ABC").

This is in a HTML tag <h2>.

¿Fue útil?

Solución

Then you need to do the following

strText = selenium.getText("//h2")

if strText.equals("ABCDEF")
     System.out.println("TextMatch")
else
     System.out.println("Text Mismatch")
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top