February 13, 2008
SilkTest Tip18 - Tooltip verification in web pages
SilkTest does not have built-in function, to get tooltip from browser controls. In a browser there is no actual ToolTip control, but the alt tag is sometimes used to simulate a ToolTip.
Silktest can execute javascript statements. By using that, we can get tooltip from web objects. In the following example sAltProp variable gets the tooltip of AutoImage object.
STRING sAltProp = MyApp.AutoImage.ExecMethod('getAttribute("alt")')
Similarly we can use javascript to get more info from that object. I will write another tip for javascript execution.
4 comments:
I haven't tested it, whether it works or not.
But the technique of reading tool tip thru java script is really good.
Any way how r u palani, it is nice to see u r posts. They are really good.
Sada,
I have used in our project and working well. Using Javascript, we can do many things by silktest.
I'm doing good. Thanks for your time..
A note from web front-end developer:
Technically, alt is valid only for images and shouldn't be used for tooltip behaviour. When we want to have cross-browser tooltip, we use title attribute nowadays.
Hence it is better to write some more advanced javascript to scratch the tooltip text out. Also, this is not helpful, when we use some UI frameworks to forge the GUI in browser.
I agree.. Now-a-days web developers are using adv techniques and few times I have faced this issue.
Even I have faced in couple of places and it is a limitation from tool vendor.
Post a Comment