0

I have several emails in my inbox. Using Selenium WebDriver, Java, I need to select and open unread email from known sender. I.e. I may have multiple unread mails but only 1 unread mail from that sender. I know the email replay-to address and the email title. I also have previous emails from that sender with the same replay-to address and title. The relevant HTML code of the inbox is below.

<div class="b-datalist__body">
<div class="b-datalist__item js-datalist-item b-datalist__item_unread" data-id="14330546790000000417" data-bem="b-datalist__item">
<div class="b-datalist__item__body">
<a class="js-href b-datalist__item__link" data-subject="Just one more step to join einstein™ World" title="noreply@einsteinworld.com" data-name="link" href="https://e.mail.ru/message/14330546790000000417/" rel="history">
   <div class="js-item-cbx b-datalist__item__cbx">
      <div class="b-datalist__item__status">
         <span class="b-datalist__item__status-reply"></span>
         <span class="b-datalist__item__status-unread">
            <div class="b-letterstatus b-letterstatus_unread" data-act="unread" data-id="14330546790000000417">
               <div class="b-letterstatus__icon ico ico_letterstatus ico_letterstatus_unread "></div>
            </div>
         </span>
      </div>
      <div class="b-datalist__item__flag">
         <div class="b-datalist__item__panel">
            <div class="b-datalist__item__date">
               <div class="b-datalist__item__pic" style="background-image: url("https://filin.mail.ru/pic?user=msanity@mail.ru&email=noreply@einsteinworld.com&trust=false&sign=e366b23f0d97edf2af9141d31c8a28086db00318&&&width=32&height=32&name=noreply%40einsteinworld.com&version=4&build=7");">    
            </div>
            <div class="b-datalist__item__info">
               <div class="b-datalist__item__subj">
                  Just one more step to join einstein™ World
                  <span class="b-datalist__item__subj__snippet">Thanks for joining einstein™ World! All you need to do to finish the sign up process is verify your  </span>
               </div>
               <div class="b-datalist__item__addr">noreply@einsteinworld.com</div>
            </div>
         </div>
</a>
</div>
</div>

P.S. I can use any other email service like Gmail, Yahoo etc but I think the situation will be similar.

Saifur
  • 16,081
  • 6
  • 49
  • 73
Prophet
  • 32,350
  • 22
  • 54
  • 79
  • Are you asking for selector or you have anything you tried? – Saifur Jun 02 '15 at 13:32
  • If you can suggest such css selector and it will work it would be perfect. I have already written some simple Selenium WebDriver codes but still not worked with the inbox. I see that the read/unread indicator and the title and replay-to address are sitting under the same roof but I don't know how to use that. I'm still new in WebDriver... – Prophet Jun 02 '15 at 13:39

0 Answers0