Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tabbed browsing: Unable to handle child tabs
08-24-2009, 11:21 AM
Post: #1
Tabbed browsing: Unable to handle child tabs

Hallo,

I am testing a web application explicitly making use of the tabbed browsing by generating new tabs for several child tasks. I use QTP 10.0 which supports tabbed browsing in general and after some "trial and error" cycles I am able to use this feature in principle.

BUT: In replay mode child tabs test run are not recognized if they are generated during a test step executed by QTP.

So this test (pseudo code)

If child tab (page) is not open
Open Child tab (by link on parent tab)
Do something with child tab


would fails if child tab is not open at the beginning of the test and will pass if you ensure the tab to be open before starting the test.

Maybe anybody has experienved the same problem?

Michael
Find all posts by this user
Quote this message in a reply
08-24-2009, 11:43 AM
Post: #2
RE: Tabbed browsing: Unable to handle child tabs
watch out the creation time, may be it is causing the issue. try descriptive when you use your browser object.

Thanks,
~Saket Kumar
[Linkedin][pdf Api for QTP]
It's so hard when I have to, and so easy when I want to...
Find all posts by this user
Quote this message in a reply
08-24-2009, 02:56 PM
Post: #3
RE: Tabbed browsing: Unable to handle child tabs
(08-24-2009 11:43 AM)Saket Wrote:  watch out the creation time, may be it is causing the issue. try descriptive when you use your browser object.

Hi Saket,

thanks for the quick response.

Creation time:
I use index as ordinal identifier instead of the creation time (this is what you meant, isn't it) but tried creation time after your comment. Unfortunately there is no change.

Descriptive approach
Even if descriptive object identification would be the solution, it would not be helpfull as all child objects of the affected tab have to be invoked in a descriptive way also, right? I would like managing my testobjects in a shared TO repository sinse they change frequently.

Michael
Find all posts by this user
Quote this message in a reply
08-24-2009, 03:22 PM
Post: #4
RE: Tabbed browsing: Unable to handle child tabs
what is the error you are receiving? can you paste your lines of code as well?

Thanks,
~Saket Kumar
[Linkedin][pdf Api for QTP]
It's so hard when I have to, and so easy when I want to...
Find all posts by this user
Quote this message in a reply
08-24-2009, 04:14 PM
Post: #5
RE: Tabbed browsing: Unable to handle child tabs
(08-24-2009 03:22 PM)Saket Wrote:  what is the error you are receiving? can you paste your lines of code as well?

OK, here is the code:
Dim BrowserTab_1, BrowserTab_2

'The following assignment is just a preparation for future use
Set BrowserTab_1 = Browser("Web1")
Set BrowserTab_2 = Browser("Web2")


If Not BrowserTab_2.Page("Import").Exist Then
Reporter.ReportEvent micWarning, "Detecting Import page", "Page not found"
If Not BrowserTab_1.Page("Home Page").Exist Then
Reporter.ReportEvent micFail, "Open Import Page", "Home page not found"
ExitTest
Else
BrowserTab_1.Page("Columbus Home Page").Link("Import").Click
Reporter.ReportEvent micDone, "Open Import Page", "Executed"
Wait(120)
End If
Else
Reporter.ReportEvent micDone, "Detecting Import page", "Page found: "+ BrowserTab_2.Page("Import").GetROProperty("url")
End If


If Not BrowserTab_2.Page("Import").Exist Then
Reporter.ReportEvent micFail, "Open Import Page", "Unable to open Import page"
ExitTest
End If
'Actions for Import-page here


So the test fails within the latest If-statement. If this conditional statement was not present, the test would fail with an "Object not visible exception" in the following actions.
Find all posts by this user
Quote this message in a reply
08-24-2009, 04:56 PM (This post was last modified: 08-24-2009 05:00 PM by Saket.)
Post: #6
RE: Tabbed browsing: Unable to handle child tabs
hey, I am still not able to understand the query... what is the use of your last If statement, you are already doing the same in the above statements, may be you can exit the test at that stage only. I just tried the code and it works perfect on my side.
Please format the code if you are posting any.. use
Code:
....your code....
. the post becomes much readable using this.

Thanks,
~Saket Kumar
[Linkedin][pdf Api for QTP]
It's so hard when I have to, and so easy when I want to...
Find all posts by this user
Quote this message in a reply
08-24-2009, 05:40 PM (This post was last modified: 08-24-2009 05:52 PM by HazleVillage.)
Post: #7
RE: Tabbed browsing: Unable to handle child tabs
(08-24-2009 04:56 PM)Saket Wrote:  hey, I am still not able to understand the query... what is the use of your last If statement, you are already doing the same in the above statements, may be you can exit the test at that stage only. I just tried the code and it works perfect on my side.
Please format the code if you are posting any.. use
Code:
....your code....
. the post becomes much readable using this.

The purpose of checking the existance of the child ("Import") page twice is this:
The first ...Page("Import").Exist statement checks if the page is visible initially (maybe opened by a previous testrun). If not, the page will be openend explicitly.
The second ...Page("Import").Exist statement is just error handling: If the testscript is unable to open (or recognize) the page, exit test instead of runnning in an ugley exception.

Of course I could place the second within the inner Else -branch of the first conditional structure. The reason why I didn't is that I places this statement subsequently - when I realized that there could be a problem in opening the page.
Maybe I should explain the workflow of the application under test -it's a locally running web application - more detailed.

- Initially there is a home page providing access to several functionalities of the application, e.g. the "Import" functionality
- By clicking on the desired link, a new tab will be opened showing the web page of the corresponding functionality (e.g. "Import")
- In this case the browser contains two tabs: One for the homepage, one for the child page
- When recording QTP identifies both elements on the home page and the child page
- When running the test starting with the homepage (no child page opened) the "Import" link is clicked and the child page opened. But then QTP is unable to recognize the child page
- If you start the test with the child page already opened (regardless if it is opened by a previous testrun or manually), the test passes

Michael
Find all posts by this user
Quote this message in a reply
03-22-2011, 12:44 PM
Post: #8
RE: Tabbed browsing: Unable to handle child tabs
How to identify multiple pages in a single browser.....?


thanks inadvance
Suman.P
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Unable to identify Child Object for a window application created using C#. ssanjeev 3 1,546 09-16-2010 10:22 AM
Last Post: Saket
  Child nodes in a treeview vikas.sharma 1 1,121 09-01-2010 01:38 PM
Last Post: basanth27
  Need Help in getting AcxButton count (i.,Child object) within a window/form praneeth_be 0 306 11-13-2009 11:55 AM
Last Post: praneeth_be
  SAPGuiTree Navigation to child objects Sreedevi 0 1,126 06-05-2009 04:59 PM
Last Post: Sreedevi
  Need Recoveries to handle Run Time Errors dvkbabu 2 872 03-26-2009 02:41 PM
Last Post: dvkbabu

Forum Jump:


User(s) browsing this thread: 1 Guest(s)