Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I create a generic function to get Page Titles?
#1
Not Solved
I wanted to write a function to get page titles and pass it to return variable that I can use for the script when verifying the page title name. Is there syntax to also write the result to a file so I can find out if the variable value is correct or not.

Plus I want to do the same for Brower().Page(), etc. I started it, I do not know what to do from here. I used to write automation in C# and I was able to find and replace a variable from a function to pass it to the next set of code.

' *****************************
' Name: GetPageTitle
' ****************************
Code:
Function GetPageTitle(pageTitleName)
pageTitleName = Browser("CreationTime:=0").Page("title:=.*").GetROProperty("title")
return pageTitleName
End Function
' ******************************
Reply
#2
Not Solved
Instead of using Browser("CreationTime: = 0) use Browser("CreationTime: = .*)
Reply
#3
Not Solved
Thank you so much, how do you pass the variable to the next step or action: Browser("whatever").Page("whatever")......etc. What is the syntax to replace "whatever"?

Also how do you write the results of the variables to a log file so I can use it for troubleshooting? Thanks again
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Calling a function in a Test Script from a function library anupam4j 3 6,114 06-26-2015, 12:31 AM
Last Post: babu123
  Cannot find the "[ WebButton ]" object's parent "[ Page ]" (class Page) sumitparolkar@gmail.com 4 5,074 05-03-2013, 11:53 PM
Last Post: agarwl.anurag
  Hep to create yahoo log in function. jinnah1978 1 2,852 02-23-2012, 10:24 AM
Last Post: inborntester
  Generic name not working Browser("name:=.*").Page("name:=.*") shortduck 0 3,308 08-12-2011, 01:28 AM
Last Post: shortduck
  Create new Memo field in Defects page 2 kfschaefer 0 3,121 04-28-2011, 12:27 AM
Last Post: kfschaefer

Forum Jump:


Users browsing this thread: 1 Guest(s)