How to obtain window title in Web application?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-02-20 08:12 PM
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
------------------------------
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-02-20 08:34 AM
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
------------------------------
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
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-02-20 01:11 PM
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
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
