I am not sure how I can write code in java to test HTML code.
I have to match several strings on HTML page. My HTML page looks like
name: xyzfoo
standard: 5
division: C
But all this is hardcoded in
<tr>...
</tr>
and not associated with any element id. So I am not sure how to test if string matches with the one that I am expecting by using selenium with Java.
Using Selenium’s WebDriver you can use a XPath or CSS selector to locate an element. At this point you can retrieve the text in the desired element and compare it with your own.
If you are going down the testing path and are using Visual Studio/Microsoft Products then you may want to read up a but on Coded UI Tests. This is just one option as there are alternative testing packages out there.