Ask a Question

How can I capture the displayed edge browser title (WndCaption)?

bo_roop
Contributor

How can I capture the displayed edge browser title (WndCaption)?

I have an existing keyword test that maximizes a browser based upon its WndCaption... all browsers besides Edge match the displayed tab's title. Edge however returns a WndCaption of "Microsoft Edge" instead of the Google title.

 

Google TabGoogle Tab

Is there a setting I can change to get this working again so I don't have to update NameMapping and my existing tests?

 

Thanks!

6 REPLIES 6
tristaanogre
Esteemed Contributor

Actually, I think that's probably better captured, not as the WndCaption, but something more like

 

Sys.Browser('*').Page('http://my.page.url').contentDocument.title

 

 


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

Thanks. I'm trying to get it to work the way it used to work in IE, Firefox and chrome... without modifying existing functionality if possible.

 

I see that your way works but do you know of a way to get Edge & TestComplete to work together as the other browsers do?

 

FWIW, Windows also displays "Google - Microsoft Edge" when Alt+Tabbing between windows.

tristaanogre
Esteemed Contributor

Edge is it's own monster.  Honestly, I don't know.  However, even for your existing browser, that code should work. That contentDocument.title is part of the actual HTML document for the page so it is a global property available no matter what the browser.  If your intent is to work in multiple browsers, that would be the best practice to follow.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Marsha_R
Community Hero

Have you checked all these settings?

 

https://support.smartbear.com/testcomplete/docs/app-testing/web/general/preparing-browsers/edge.html


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame

Yes, the browser is configured properly and TestComplete settings have been applied. The browser is recognized as Edge so I know it's working.

 

It's just the difference in the WndCaption that I'm noting. 😞 

Then I would go with @tristaanogre's solution.  It should work for all the browsers.  


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
cancel
Showing results for 
Search instead for 
Did you mean: