Answers

Question and Answer:

  Home  SilkTest

⟩ I would like to verify the title of the new browser window that just popped after clicling link?

I am not using any frame file with my scripts.I dynamically get all the links in a web page and click on the link I want to, by matching its caption....The problem I am facing is that, when I click a link "x" on a webpage it opens a new browser window.I would like to verify the title of the new browser window that just popped after clicling link "x".Since I am not using frame file I find it difficult to retrive the title of new browser window.....Any solution ?

Ttry with GetCaption ()....

BrowserPage.Getcaption () --> It would return the caption/title of the page...Compare it with the expected value...

Yes, here you have to make sure that the new invoked page gets the attention.....

BrowserPage.SetActive ()

BrowserPage.Getcaption ()

if

the caption is not same as the initial page, this is the new invoked page and what you desire

else

Desktop.TypeKeys ("")

if

if BrowserPage.IsActive ()

get the caption and check as earlier

else

Desktop.TypeKeys ("")

This is just a rough algol, you have to implement it with appropriate loop so that it becomes independent of the number of currently invoked windows....

 167 views

More Questions for you: