Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
viresh.sb
Active particpant
Active particpant
Posts : 19
Join date : 2011-03-21

how find no unread and emails in a gmail  Empty how find no unread and emails in a gmail

Sun Apr 08, 2012 3:40 pm
Hi All ,


How to find the no of email s in gmail or yahoo mail ? is there any direct API to find it in selenium API

Unread/read.

finding 2 or 3rd element in a drop down/

Regards
Viresh SB
9980867000
Advisor
Advisor
------------------------
------------------------
Posts : 387
Join date : 2009-07-30
Location : India
https://seleniumforum.forumotion.net

how find no unread and emails in a gmail  Empty Re: how find no unread and emails in a gmail

Tue Apr 10, 2012 1:38 pm
hi,

There is no API present to verify email functionality, you have to write your own code for that.

1 to check nmuber of emails:
create a xpath where number of mails in inbox show. get its text and verify.

2. to check unread mails:
traverse to each row via xpath and check the message. If it is coming in bold, it's unread else readed.
3. regarding element in drop down:
create a xpath for drop down list. get total number of elements and then fetch any values

For commaands used to get the above operation performed refer seleneium API. All commands availiable in that

Best of luck.

Bye
avatar
mckiranlieutenant007@gmai
Posts : 4
Join date : 2013-04-22

how find no unread and emails in a gmail  Empty Re: how find no unread and emails in a gmail

Wed May 08, 2013 4:24 pm
It involves checking any of the mail attributes such as FROM, SUBJECT etc.

In INBOX, traverse through either FROM or SUBJECT field and check if they have CSS style "font-weight:bold" OR you can verify if that element has a class that applied this BOLD style.

Example: XPath of FROM field which is bold'ed (Un-Read) is
Code:
//table/tbody/tr[1]/td[5]/div[@class='yW']//span
Now, if you can loop in such a condition where the Class of span element is 'zF' then count++ if the condition is true.

A similar example to read and show the UN-Read mails is explained at http://www.seleniumhq.in/2013/05/read-first-few-un-read-mails-using.html
avatar
mckiranlieutenant007@gmai
Posts : 4
Join date : 2013-04-22

how find no unread and emails in a gmail  Empty Re: how find no unread and emails in a gmail

Wed May 08, 2013 5:39 pm
This is the exact selenese code that gets the unread count of all folders and shows in an alert.

Code:
store | //div[@class='LrBjie']/div/div[ | target1
store | ]/div/div/div/span/a | target2
store | 1 | i
store | true | present
store |  | countsAll
while | ${present}==true |
storeEval | storedVars['target1']+storedVars['i']+storedVars['target2'] | target
echo | ${target} |
storeText | javascript{storedVars['target']} | counts
storeEval | storedVars['countsAll']+'  $  '+storedVars['counts'] | countsAll
echo | ${countsAll} |
storeEval | parseInt(storedVars['i'])+1 | i
storeEval | storedVars['target1']+storedVars['i']+storedVars['target2'] | target
storeElementPresent | javascript{storedVars['target']} | present
echo | ${present} |
endWhile |  |
storeEval | javascript{alert(storedVars['countsAll'])} | countsAll

More posts available at http://www.seleniumhq.in/


Last edited by mckiranlieutenant007@gmai on Wed May 08, 2013 5:41 pm; edited 1 time in total (Reason for editing : Uploading Image)
Sponsored content

how find no unread and emails in a gmail  Empty Re: how find no unread and emails in a gmail

Back to top
Permissions in this forum:
You cannot reply to topics in this forum