cancel
Showing results for 
Search instead for 
Did you mean: 

How to obtain window title in Web application?

HarishM2
Level 6
Hi,

 I'm automating share point through Internet Explorer . I want to Obtain window  title for attached Application. How can iI obtain title for Attached Web application. I was aware  I can spy the title and read the value . My question  is there any other way other than spying the title of the window to capture the window value?



Thanks,
Harish

------------------------------
Harish
RPA Developer
------------------------------
2 REPLIES 2

Hi, Harish,

you can but you need to understand code stage. If you look at VBO Utility - General, action Window Exists you will see this code in code stage. So instead of searching for window title you can just read it via p.mainwindowtitle.

try
if wildcard then
    title = title.replace("*", ".*")
    title = title.replace("?", "\w")
end if

exists = false

for each p as system.diagnostics.process in system.diagnostics.process.getprocesses()
  if wildcard then
    if system.text.regularexpressions.regex.ismatch(p.mainwindowtitle, title) then
        exists = true
        exit sub
   end if
else
    if p.mainwindowtitle.tolower = title.tolower then
        exists = true
        exit sub
    end if
end if
next

catch e as exception
end try

------------------------------
Zdeněk Kabátek
Head of Professional Services
NEOOPS
http://www.neoops.com/
Europe/Prague
------------------------------

david.l.morris
Level 15
I just noticed I posted in the non-active version of this thread, so I'm pasting here too.

Here's the other thread where I responded: The other thread

And here's the same text I posted over there:

You should be able to use a Read stage to get an attribute value. I suppose it depends what element you're retrieving the attribute value from.

If you spy the entire window in Win32 mode, then you should be able to get the Window Title out of the 'Window Text' attribute. Use a Read stage on the Win32 element using the action 'Get Text'.

If you use AA mode to spy the entire window, then you can do something similar but this time in the Read stage, the attribute may be called 'Name' and the action may be called 'Get Name'. But it gets the same text.

For UIA mode again spy the entire window, and then it's the same as AA where the Read stage action is called 'Get Name', but attribute in the list is actually called 'UIA Name'.

I'm not sure you can get the actual window title name from HTML mode. Maybe there's a way, but I don't see it and I think it'd be webpage dependent.

------------------------------
Dave Morris
3Ci @ Southern Company
Atlanta, GA
------------------------------

Dave Morris, 3Ci at Southern Company