Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
capturing the name of a variable browser page
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
I'm testing a website that has a Logout link that is visible from every page (nearly 700). I want to write a function that can be called from any page, which will click the Logout link.
The problem I'm having is that I need to be able to supply the function with the name of the current page (which could be different every time) - any ideas how I can capture the current page?
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
You can use the descriptive program to handle this situation.

Ex: Browswer(FunctionParameter).Page(FunctionParameter).Link("name:=Logout").Click

Let me know if you need any more information.
Thanks,
SUpputuri
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
Regular expression can be used:

Browswer("name:=.*").Page(title:=.*).Link("name:=Logout").Click

Rajeshwar
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
you can identify you generic browser(say myb) object and page(say myp) with
Code:
Dim myb, myp
set myb = description.create()
myb("title").value = ".*"  [i]'this must identify your browser whenever it is open - even on different pages[/i]
'U can confirm if it is there with
If Browser(myb).Exist = True
print "Browser Exists"
Else
Print "Browser is Absent"
End if

'For the page
set myp = description.create()
myp("title").Value = ".*Google.*  [i]'if U're working with google(4 instance), every google page is covered here.[/i]

If page(myp).Exist = True
print "Page Exists"
Else
Print "Page is Absent"
End if

' Ur page code will be identified in every page.

Thanks

Vic
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  DP Web Browser/Page issues rstimers 1 2,450 08-14-2015, 12:37 PM
Last Post: venkatesh9032
  Cannot find the "[ WebEdit ]" object's parent "[ Browser ]" (class Browser). Verify t Divya Roopa 1 8,474 03-11-2014, 12:13 PM
Last Post: devarapallliramana
  Function to create web objects (like Browser, Link, Page, etc) Arena 2 3,824 04-03-2012, 08:21 AM
Last Post: Arena
  Capturing movie in qtp sowmya 2 2,806 01-29-2012, 11:44 AM
Last Post: basanth27
  Capturing PopUp link siwani 0 2,446 06-10-2011, 03:16 AM
Last Post: siwani

Forum Jump:


Users browsing this thread: 1 Guest(s)