Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to get a style property
#1
Hi,

I try to test the visibility of an error tooltip. Once the tooltip was raise its associated object is already present in page but only visible in certain circumstances

Using Firefox firebug, I can see the following informations:

WHEN TOOLTIP IS VISIBLE :

Code:
<div id="dijit__MasterTooltip_0" widgetid="dijit__MasterTooltip_0" [color=#1E90FF]style="top: 288px; left: 459.5px; opacity: 1;"[/color] class="dijitTooltip dijitTooltipRight" <div class="dijitTooltipContainer dijitTooltipContents" wairole="alert" dojoattachpoint="containerNode" role="alert">Alert Message</div> <div class="dijitTooltipConnector"></div> <iframe class"=dijitBackgroundIframe" src="javascript:""" styme="opacity: 0.1; width: 100%; height: 100%;" tabindex="-1"> <html> <head> </head> <body></body> </html> </iframe> </div>

WHEN TOOLTIP IS NOT VISIBLE : (only first div style change)

Code:
<div id="dijit__MasterTooltip_0" widgetid="dijit__MasterTooltip_0" [color=#1E90FF]style=""[/color] class="dijitTooltip dijitTooltipRight" ... (same as previously) </div>



Using QTP spy i am able to catch two objects related with the tooltip when visible:
FIRST :
Code:
Browser("").Page("").WebElement("Alert message") with class name = webElement abs_x = 507 abs_y = 445 class = dijitTooltipContainer dijitTooltipContents height = 26 html tag = DIV inner html = Alert message inner text = Alert message outerhtml = <DIV class="dijitTooltipContainer dijitTooltipContents" dojoAttachPoint="containerNode" waiRole="alert" role="alert">Alert message</DIV> outer text =Alert message visible = True width = 121 x = 474 y = 293

SECOND :
Code:
Browser("").Page("").WebElement("WebElement") with class name = WebElement abs_x = 493 abs_y = 454 class = dijitTooltipConnector height = 14 html tag = DIV outerhtml = <DIV class=dijitTooltipConnector></DIV> visible = True width = 16 x = 460 y = 302
When I try to get style info for the first DIV i always got an error from QTP

* this works fine but always return True
Code:
toolTipVisible = Browser("").Page("").WebElement("html tag:=DIV", "html id:=dijit__MasterTooltip_0").GetROProperty("visible")

* this never works
Code:
style = Browser("").Page("").WebElement("html tag:=DIV", "html id:=dijit__MasterTooltip_0").GetROProperty("style")



Is there any way to get div id="dijit__MasterTooltip_0" style informations ??

thanks
Reply
#2
try this
Code:
style = Browser("").Page("").WebElement("html tag:=DIV", "html id:=dijit__MasterTooltip_0").Object.Currentstyle msgbox style.top

does this help?

Reply
#3
It does !!!

but with Object.Currentstyle, top property was always set.

I found a way using Object.style instead. And now, top is empty when tooltip is hidden.

many thanks for this tip.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  unable to identify Checkbox Property inside the WinList Object tech.savy987@gmail.com 2 5,035 07-20-2012, 10:18 AM
Last Post: Shridevi.Salagare

Forum Jump:


Users browsing this thread: 1 Guest(s)