Is it possible to get Class type of any control on Web Page with the help of it's tag value?
My problem is, i know only the tag of the Control but don't have info about the class type of that control on Web page.
Thanks in advance.
You could call .IsOfClass and use a switch or if-else to handle the possibilities.
Sample code with IsOfClass:
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">
[ ] window ActiveWindow = Desktop.GetActive ()
[ ] ExceptPrint()
[-] if (!ActiveWindow.IsOfClass(XulTemplateDlg) && !ActiveWindow.IsOfClass(DialogBox))
[-] while (BrowserPage.GetLocation() != whichPage)</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">
Chris R Mead
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
How do you have the tag and not the object? At some point you can discover the objects on the page. See the GetLinks () topic for info on how to discover the objects on a page.
There's also ClassOf (w), window.GetClass () and window.Class
John W Green
Thanks Chris and John for quick response.
Here my problem is something different then what you have suggested.
As we know each control on a Web page have one Htmltext associate to it. and it's caption value can be used as prior text tag of that control.
so i want to know the control's class type using this prior text tag value.
Please let me know if required more input from my side.
Thanks in advance
You can use FindWindow function, but this function work only with declared windows.
If you want find windows at run time, you can use GetChildren function and than find in returned windows list needed windows and define their class.