Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Deleting portion of URL using QTP and Appending to Existing URL
#1
Solved: 11 Years, 3 Months, 1 Week ago
Hi ,

I have a query and would like to have your suggestions :

I am opening a Browser and navigating to my desired URL in which I provide the login credentials to proceed further .

Next I need to delete a portion of my existing URL (only portion of URL , not whole) and append to the remaining URL through QTP Scripting in order to perform other steps .I can't use Trim function because i don't have to deal with space here .

Any idea on deleting a portion of existing URL and adding a portion to it using QTP Scripting .

Regards,
Faisal Rashid
Reply
#2
Solved: 11 Years, 3 Months, 1 Week ago
Get the Current page url
take out the portion of url you want to remain
and then append your desired url portion in it.

I have tried to do this in form browser itself, see the code below
Code:
sPageUrl = Browser("Deleting portion of URL").Page("Deleting portion of URL").GetROProperty("url")
sMainUrl = Mid(sPageUrl,1,instrrev(sPageUrl,"/"))
sMainUrl = sMainUrl & "storing-data-in-excel-sheet-t-2828.html"
Browser("Deleting portion of URL").Navigate sMainUrl

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Code not recognising Browser object as existing brigna 0 1,810 12-04-2014, 08:32 PM
Last Post: brigna
  Qtp can not identify existing script prit deo 0 1,904 03-03-2014, 04:23 PM
Last Post: prit deo
  Need to embed worksheet to already existing excel mahaktikoo 1 2,423 09-27-2012, 12:13 AM
Last Post: krr
  How to identify the object reference to the existing(already opened) Excel sheet yogeesh 1 9,933 09-26-2012, 07:00 PM
Last Post: krr
  ‘General Run Error’ when trying to fetch URL in Browser Address Bar with DP sukhvinderh 5 5,736 10-14-2011, 07:29 PM
Last Post: v.swaminathan

Forum Jump:


Users browsing this thread: 1 Guest(s)