Logging metadata

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Logging metadata

Greg Martz-2
Good morning!

I'm using Selenium and Page Objects.  All individual page objects extends the master Page Object.  In the master Page Object, I'd like to log the pages metadata.  All meta data including the name and the content.  Here is what it looks like from our page source:

<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <title>
    Welcome to My Website
    </title>
    <!-- START HomeSeoMetaData.jsp -->
<meta name="currentBuildNumber" content="3.0.33666.0" />
<meta name="currentSolrBuildNumber" content="3.0.33555.0" />
<meta name="ServerName" content="www-vqa2.xxx.com " />
<meta name="LocalAddress" content="xxx.xxx.xxx.128" />
<meta name="LocalName" content="TP01" />

<meta name="google-site-verification" content="" />


<link rel="icon"  type="image/vnd.microsoft.icon" href="/wcsstore/xxxGLOBALSAS/images/favicon.ico" type="image/x-icon"> 
<link rel="shortcut icon"  type="image/vnd.microsoft.icon" href="/wcsstore/xxxGLOBALSAS/images/favicon.ico" type="image/x-icon">


<meta name="description" content="This is the description content. "/>
<meta name="keyword" content="USBC, , Electronics, Computers, Appliances , Furniture &amp; Mattresses, Tires &amp; Auto, Floral, Gifts &amp; Books, Jewelry, Watches &amp; Sunglasses, Patio, Lawn &amp; Garden, Home Improvement, Home &amp; Kitchen, Office Products, Clothing, Luggage &amp; Handbags, Health &amp; Beauty, Baby, Kids &amp; Toys, Grocery &amp; Household, Sports &amp; Fitness, View More Categories, Landing Pages, Pharmacy Feature Pages, Shop With Us for electronics, computers, furniture, outdoor living, appliances, jewelry and more. Enjoy low prices on name-brands products delivered to your door. "/> 
  </head>
</html>

Can anyone come up with a good quick, clean method to iterate through all of the meta elements logging all of the attributes and values (Mainly the "meta" elements and the text of the "title" element)?

Thanks!
Greg

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAJ5e%3Deiede3AHTFHJTyEktSPd7vkx-Ew2AgYcX856M9BL3ZvPw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.