Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP and secondary web pages
#1
Solved: 11 Years, 4 Months ago
Hi,

Do you have any idea how I can skip from a web page to a new web page using QTP?
For example, I have next test:
- open an web page
- click on “test_1” link – when I click on this link a new page is open
How I can test the new open page using QTP?

Thanks
Reply
#2
Solved: 11 Years, 4 Months ago
How is it behaving now, when you attempt to record it.
Was creation time property of any help?
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#3
Solved: 11 Years, 4 Months ago
Sorry, I wasn't very clear.

The second page can be accessed if I make a record and after that I run the test. My problem is how to skip from a page to another page using descriptive programming. I do not use OBJECT REPOSITORY and the name of the web page is automatically retrieved.

Something like this:

Code:
Set IE = CreateObject("InternetExplorer.Application")
IE.Navigate  "http://xxxxxxxx.xx/"
IE.Visible = True
IE.Width = 850
IE.Height = 720

Function  GetPageName(IE)
  Do
     wait(0.1)
     Loop while IE.Busy = TRUE
     GetPageName=IE.document.title
End Function

pageName = GetPageName(IE)

Set obj_DescAssert = Description.Create
BrowserName="name:="+pageName
TitlePageName="title:="+pageName
Browser(BrowserName).Page(TitlePageName).WebButton("Help").Click
#the Help button open a new page

Here is the problem. I do not know how to get the name of the second page using descriptive programming (SecondBrowserName=?, SecondTitlePageName=?)

Browser(SecondBrowserName).Page(SecondTitlePageName).Link("Adding a New Group").Click


Thanks
Reply
#4
Solved: 11 Years, 4 Months ago
I found how to resolve this issue
First we must get all IE open pages using next script:
Code:
function getSecondIEPage(FirstPageName)
      set x=Description.Create
      x("micclass").value="Browser"
      Set obj=Desktop.ChildObject(x)
      NoPages = obj.count
      For i=o to NoPages-1
           y=obj(i).getroproperty("name")
           If  FirstPageName = y Then
                    msgbox("This is the name of the first IE page that I opened")
           else
                    getSecondIEPage = c
           end If
       Next
End Function


The function return the name of the second IE page. The script work only if you have 2 IE pages opened.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Pages and Frames adding _1, _2, _3... zunebuggy 1 1,671 05-30-2017, 12:17 AM
Last Post: Vichu M J
  I want to compare string present on two pages excellentpawan 3 3,479 07-23-2013, 02:33 PM
Last Post: ssvali
  Verify images get properly loaded or not(Broken Images) in respective pages nilanjans 4 4,078 01-17-2013, 10:51 AM
Last Post: nilanjans
  Capturing Multiple Pages tfritz13 1 2,306 12-20-2012, 10:35 AM
Last Post: sshukla12
  How to find out error pages using QTP sams001 3 5,298 12-17-2012, 11:40 PM
Last Post: udayanem

Forum Jump:


Users browsing this thread: 1 Guest(s)