I am trying to programmatically get all the meta tags in the head portion of a page. I have tried the below code
and the list comes as empty despite there being 2 meta tags in the head section.
<head>
<meta charset="utf-8">
<meta name="robots" content="NOODP,NOYDIR">
</head>
repo headsection rxpath
/dom/head
Ranorex.HeadTag headTag = repo.DOM.headsection; IList<Ranorex.MetaTag> metaTags = headTag.FindChildren<Ranorex.MetaTag>(); foreach (Ranorex.MetaTag metaTag in metaTags) { Report.Info(metaTag.Name); }I can on the other hand obtain an adapter to the first metatag using a repo item with rxpath head/meta[1]
Why is the IList empty in the code example?
I am looking many pages and do not know how many and which meta tags I will find on each page so would prefer to obtain the meta tags dynamically on each page.
Your help is appreciated.
Thanks,
Stacey