How to handle tooltip in selenium

4,619 views
Skip to first unread message

ram navuluri

unread,
Apr 30, 2012, 1:55:37 AM4/30/12
to seleniu...@googlegroups.com
Hello guys,

     I am using selenium 2.19 with java 1.6 
     can anyone please suggest me how to test whether tooltip is appear or not when mouseover on element in the page

-- 
thanks in advance
Ram Navuluri

Jayaraman - Inspired to become Software Architect

unread,
May 2, 2012, 4:11:42 AM5/2/12
to seleniu...@googlegroups.com
Usually, the value of title is displayed in the tooltip of an element. So try to get the value of the title attribute of the element.
 
Could you plz try to use the getAttribute method to achieve this?
HTH!!
 
Thanks,
Jay!!

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

shweta jain

unread,
May 2, 2012, 4:34:05 AM5/2/12
to seleniu...@googlegroups.com
hey, if its not title or alt, then how can i get dynamic tooltip values

Peter Gale

unread,
May 2, 2012, 4:38:16 AM5/2/12
to seleniu...@googlegroups.com
Look into the html code for your page to determine what attribute the tooltip is stored in and use that attribute name to find the tooltip.


Date: Wed, 2 May 2012 14:04:05 +0530
Subject: Re: [selenium-users] How to handle tooltip in selenium
From: j.shwe...@gmail.com
To: seleniu...@googlegroups.com

shweta jain

unread,
May 2, 2012, 4:58:12 AM5/2/12
to seleniu...@googlegroups.com
its using svg -g format..its not a html table. so could you please tell me how to implement it???basically its a highchart

Peter Gale

unread,
May 2, 2012, 5:33:43 AM5/2/12
to seleniu...@googlegroups.com

In that case you might need to supply a sample of the page source for people to fully understand your problem.


Date: Wed, 2 May 2012 14:28:12 +0530

shweta jain

unread,
May 2, 2012, 5:46:22 AM5/2/12
to seleniu...@googlegroups.com
ok, then open :
http://www.highcharts.com/demo/bar-basic

Here, do mouse hover on any of the bar..there u can see some values.. so in my portal, these values are dynamic..
n here , in highcharts, some svg - g structure has been followed.
so how can i get these tooltip values on mouse hover...
that I need to automate

Selenium user

unread,
May 3, 2012, 5:52:32 PM5/3/12
to seleniu...@googlegroups.com
Hi,

I need to automate highcharts with selenium. Need to check presence of pie chart, bar chart etc.  Please let me know if you have any tips. xpaths are not detected.

Thanks,
Vasavi

On Wednesday, May 2, 2012 2:46:22 AM UTC-7, new_to_selenium wrote:
ok, then open :
http://www.highcharts.com/demo/bar-basic

Here, do mouse hover on any of the bar..there u can see some values.. so in my portal, these values are dynamic..
n here , in highcharts, some svg - g structure has been followed.
so how can i get these tooltip values on mouse hover...
that I need to automate



On Wed, May 2, 2012 at 3:03 PM, Peter Gale <peterjef...@hotmail.co.uk> wrote:

In that case you might need to supply a sample of the page source for people to fully understand your problem.


Date: Wed, 2 May 2012 14:28:12 +0530

Subject: Re: [selenium-users] How to handle tooltip in selenium
From: j.shwe...@gmail.com


its using svg -g format..its not a html table. so could you please tell me how to implement it???basically its a highchart

On Wed, May 2, 2012 at 2:08 PM, Peter Gale <peterjef...@hotmail.co.uk> wrote:
Look into the html code for your page to determine what attribute the tooltip is stored in and use that attribute name to find the tooltip.


Date: Wed, 2 May 2012 14:04:05 +0530
Subject: Re: [selenium-users] How to handle tooltip in selenium
From: j.shwe...@gmail.com


hey, if its not title or alt, then how can i get dynamic tooltip values

On Wed, May 2, 2012 at 1:41 PM, Jayaraman - Inspired to become Software Architect <electri...@gmail.com> wrote:
Usually, the value of title is displayed in the tooltip of an element. So try to get the value of the title attribute of the element.
 
Could you plz try to use the getAttribute method to achieve this?
HTH!!
 
Thanks,
Jay!!
On Mon, Apr 30, 2012 at 11:25 AM, ram navuluri <ram.na...@gmail.com> wrote:
Hello guys,

     I am using selenium 2.19 with java 1.6 
     can anyone please suggest me how to test whether tooltip is appear or not when mouseover on element in the page

-- 
thanks in advance
Ram Navuluri

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

On Wednesday, May 2, 2012 2:46:22 AM UTC-7, new_to_selenium wrote:
ok, then open :
http://www.highcharts.com/demo/bar-basic

Here, do mouse hover on any of the bar..there u can see some values.. so in my portal, these values are dynamic..
n here , in highcharts, some svg - g structure has been followed.
so how can i get these tooltip values on mouse hover...
that I need to automate



On Wed, May 2, 2012 at 3:03 PM, Peter Gale <peterjef...@hotmail.co.uk> wrote:

In that case you might need to supply a sample of the page source for people to fully understand your problem.


Date: Wed, 2 May 2012 14:28:12 +0530

Subject: Re: [selenium-users] How to handle tooltip in selenium
From: j.shwe...@gmail.com


its using svg -g format..its not a html table. so could you please tell me how to implement it???basically its a highchart

On Wed, May 2, 2012 at 2:08 PM, Peter Gale <peterjef...@hotmail.co.uk> wrote:
Look into the html code for your page to determine what attribute the tooltip is stored in and use that attribute name to find the tooltip.


Date: Wed, 2 May 2012 14:04:05 +0530
Subject: Re: [selenium-users] How to handle tooltip in selenium
From: j.shwe...@gmail.com


hey, if its not title or alt, then how can i get dynamic tooltip values

On Wed, May 2, 2012 at 1:41 PM, Jayaraman - Inspired to become Software Architect <electri...@gmail.com> wrote:
Usually, the value of title is displayed in the tooltip of an element. So try to get the value of the title attribute of the element.
 
Could you plz try to use the getAttribute method to achieve this?
HTH!!
 
Thanks,
Jay!!
On Mon, Apr 30, 2012 at 11:25 AM, ram navuluri <ram.na...@gmail.com> wrote:
Hello guys,

     I am using selenium 2.19 with java 1.6 
     can anyone please suggest me how to test whether tooltip is appear or not when mouseover on element in the page

-- 
thanks in advance
Ram Navuluri

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

Gulshan Saini

unread,
May 3, 2012, 10:51:09 PM5/3/12
to seleniu...@googlegroups.com
You can use selenium Action class to mouse hover on element  and then verify the tool tip by locator..

Thanks
Gulshan
www.selenium-testing.com

Oscar Rieken

unread,
May 4, 2012, 7:01:40 AM5/4/12
to seleniu...@googlegroups.com
if you can get the element you can access its attributes in webdriver you can do something like
all_g_tags = driver.find_elements(:tag_name => 'g')
all_g_tags.each do |my_g|
  if my_g.attribute('whatever') == "something specific about that locator"
    return my_g #or do something with it
  end
end

I was able to do
driver.action.move_to(my_g) #and it hovered over the g that i wanted and the tool tip popped up

the problem is in the demo is no unique way to identify the actual rect's no id's or names or names for the groupings that is unique enough to locate the exact object using xpath "might" work but it would still be brittle if the data or positioning changed it would fail the test with something like a chart i would imagine that the data changes periodically. but i will play around with it more this weekend

Nimesh.T.Prajapati

unread,
Jun 27, 2012, 11:58:58 PM6/27/12
to seleniu...@googlegroups.com
Hi,

For each bar,
/html/body/div[3]/div[2]/div/div/svg/g[11]/g[3]/rect
/html/body/div[3]/div[2]/div/div/svg/g[11]/g[3]/rect[2]
/html/body/div[3]/div[2]/div/div/svg/g[11]/g[2]/rect
/html/body/div[3]/div[2]/div/div/svg/g[11]/g[2]/rect[2]
and so on,

need to use Action class to mouse hover on this element and 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/ASNNuiG7Me4J.

To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.



--
Nimesh T. Prajapati
"Quality does matter..."

Nax143

unread,
Jun 28, 2012, 5:48:15 AM6/28/12
to seleniu...@googlegroups.com
Hi Guys ,

I have the same issue - how to handle tool tips , but its in Selenium WebDriver..

Page Source:
<table class="form">
<tbody>
<tr>
<tr>
<td>
<div>
Ticketing               
<span id="ajax2" class="callout">
<span class="moreInfoIcon"/>
<div class="calloutHeader">Ticketing</div>
<div class="calloutText">
<p>For live shows, take tickets at counter.</p>
</div>
</span>
</div>
</td>

As you can see, its a HTML table , how to handle this.

Nax143

On Thursday, 28 June 2012 04:58:58 UTC+1, nimesh prajapati wrote:
Hi,

For each bar,
/html/body/div[3]/div[2]/div/div/svg/g[11]/g[3]/rect
/html/body/div[3]/div[2]/div/div/svg/g[11]/g[3]/rect[2]
/html/body/div[3]/div[2]/div/div/svg/g[11]/g[2]/rect
/html/body/div[3]/div[2]/div/div/svg/g[11]/g[2]/rect[2]
and so on,

need to use Action class to mouse hover on this element and 
On Fri, May 4, 2012 at 8:21 AM, Gulshan Saini <gulsha...@gmail.com> wrote:
You can use selenium Action class to mouse hover on element  and then verify the tool tip by locator..

Thanks
Gulshan
www.selenium-testing.com


On Monday, 30 April 2012 11:25:37 UTC+5:30, ram navuluri wrote:
Hello guys,

     I am using selenium 2.19 with java 1.6 
     can anyone please suggest me how to test whether tooltip is appear or not when mouseover on element in the page

-- 
thanks in advance
Ram Navuluri

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/ASNNuiG7Me4J.

To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

kaush

unread,
Jul 31, 2012, 7:07:22 AM7/31/12
to seleniu...@googlegroups.com
Hi All
,Pls help me in this below tooltip message..
In my application ,i have to find the text of a tooltip that comes after performing mouseover over an image..
 
Below is the HTML code of that image.
 
<img onmouseout="hideddrivetip()" onmouseover="overlayValues('Building Information',new Array('InActive','1','-1','Basement (-1)'))"
src="views/images/buildinginfo.JPG">
 
i need to extracted the building information from that image tooltip...
as there is no title attribute...i am unable to perform that...kindly help
 
Thanks,
 
Kaush

Nax143

unread,
Jul 31, 2012, 7:15:25 AM7/31/12
to seleniu...@googlegroups.com
Hi Kaush,

You need to use Actions class.
sample code :

WebElement element = driver.findElement(By.id("id of the tool tip"));

Actions myAction = new Actions(driver);

myAction.moveToElement(element).click().perform();

Thread.sleep(2000L);

WebElement e5 = driver.findElement(By.id("tool tip window id"));

assertEquals("Expected Text",e5.getText());


Note : You need to change the coloured text  with id's and expected text.Let me know does it worked.

Regards,
Venkat

Mark Collin

unread,
Jul 31, 2012, 9:38:00 AM7/31/12
to seleniu...@googlegroups.com

There is no tooltip there.

 

A tooltip is what is entered in the title attribute of an element.  Browsers will pop up a little box showing the content of the title element when you mouse over an element.  IE makes things a bit blurry because they will show the alt attribute of an element if the title element is not populated (they shouldn’t, but hey that’s MS for you)

--

You received this message because you are subscribed to the Google Groups "Selenium Users" group.

To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/cdBog3nz9wsJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Message has been deleted

kaush

unread,
Aug 1, 2012, 12:07:35 AM8/1/12
to seleniu...@googlegroups.com
 
On Wednesday, August 1, 2012 9:35:33 AM UTC+5:30, kaush wrote:
Hi Mark,
 
Thanks for reply.
In my application that thing is behaving like tooltip only...as i have to mouseover an image to make it visible.
.Kindly Suggest how to do that in that case.
 

 
Hi Nax,
 
Thanx for the solution.I have tried it by replacing id to tool tip with image id and id_window_tooltip with id of tooltip..but it is showing general text .i.e.-for all images it is showing same message.this should not happens.
Suggest me an alternate.
 
 Thanks,
 
Kaush



On Tuesday, July 31, 2012 7:08:00 PM UTC+5:30, Mark Collin wrote:

There is no tooltip there.

 

A tooltip is what is entered in the title attribute of an element.  Browsers will pop up a little box showing the content of the title element when you mouse over an element.  IE makes things a bit blurry because they will show the alt attribute of an element if the title element is not populated (they shouldn’t, but hey that’s MS for you)

 

From: selenium-users@googlegroups.com [mailto:selenium-users@googlegroups.com] On Behalf Of kaush
Sent: 31 July 2012 12:07
To: selenium-users@googlegroups.com
Subject: Re: [selenium-users] Re: How to handle tooltip in selenium

 

Hi All

,Pls help me in this below tooltip message..

In my application ,i have to find the text of a tooltip that comes after performing mouseover over an image..

 

Below is the HTML code of that image.

 

<img onmouseout="hideddrivetip()" onmouseover="overlayValues('Building Information',new Array('InActive','1','-1','Basement (-1)'))"

src="views/images/buildinginfo.JPG">

 

i need to extracted the building information from that image tooltip...

as there is no title attribute...i am unable to perform that...kindly help

 

Thanks,

 

Kaush

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.

To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

kaush

unread,
Aug 1, 2012, 12:15:18 AM8/1/12
to seleniu...@googlegroups.com

Hi Nax and Mark,

Please find below screenshot for reference.

waiting for reply.

Kaush
cla.JPG
Reply all
Reply to author
Forward
0 new messages