Meta tags with Selenium ide

362 views
Skip to first unread message

Raja

unread,
Dec 2, 2010, 6:26:55 AM12/2/10
to Selenium Users
Hi,

Using selenium ide, can we test meta tags?
Basically test is to ensure, when i visit to site i have to make sure
that in the html source we have the below tags


1.<script type="text/javascript">
RegisterMeta("channel","x");
RegisterMeta("service","x");
</script>

2.<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1" />ooo<>
<meta name="description" content="xxxx " />
<meta name="keywords" content="yyyy" />

If it is possible then please send example code of one test. example
with any site.

I have a bit of urgency to test this.please send your advice asap.

Thanks

mam_p

unread,
Dec 2, 2010, 11:18:01 AM12/2/10
to Selenium Users

Here's an example using Yahoo's News page. The first
storeElementPresent should return false and the second one true....

<tr>
<td>open</td>
<td>http://news.yahoo.com</td>
<td></td>
</tr>
<tr>
<td>storeElementPresent</td>
<td>//meta[@name='nonexistent']</td>
<td>found</td>
</tr>
<tr>
<td>echo</td>
<td>${found}</td>
<td></td>
</tr>
<tr>
<td>storeElementPresent</td>
<td>//meta[@name='title']</td>
<td>found</td>
</tr>
<tr>
<td>echo</td>
<td>${found}</td>
<td></td>
</tr>

Reply all
Reply to author
Forward
0 new messages