Active TopicsActive Topics  Display List of Forum MembersMemberlist  CalendarCalendar  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin


 One Stop Testing ForumTesting Tools @ OneStopTestingQuickTest Pro @ OneStopTesting

Message Icon Topic: Donate a user defined function to this topic

Post Reply Post New Topic
Author Message
adela
Newbie
Newbie
Avatar

Joined: 25Apr2007
Online Status: Offline
Posts: 1
Quote adela Replybullet Topic: Donate a user defined function to this topic
    Posted: 25Apr2007 at 4:19am
I found similar topic for SilkTest tool and I though it is a good iead to do it for QTP too.

It will be very nice to see the invaluable findings at one place.
May I urge other experts on this forum to contibute user define function
and the problem you faced and the tips to overcome.

To start with I have a function as below.

Get Root Element attribute's value from XML file


Function GetRootElementAttributeValueFromXML(sFileNameWithPath,sAttribute)
' Why we need to ADD 2 because each attribute followed by (=) and (")
iLenOfValue=len(sAttribute) + 2
Set doc = XMLUtil.CreateXML()
doc.LoadFile sFileNameWithPath
Set root = doc.GetRootElement()
If instr(1,root,sAttribute) <= 0 then
Reporter.ReportEvent micFail,sAttribute,"Not Found in XML file."
exitrun(0)
else
sStartPos=instr(1,root,sAttribute) + iLenOfValue
sEndPos=instr(sStartPos,root,"""")
GetRootElementAttributeValueFromXML=mid(root,sStartPos,sEndPos - sStartPos)
end if
End Function

msgbox(GetRootElementAttributeValueFromXML("c:\temp\request.xml","MerchantId"))




Post Resume: Click here to Upload your Resume & Apply for Jobs

IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.102 seconds.
Vyom is an ISO 9001:2000 Certified Organization

© Vyom Technosoft Pvt. Ltd. All Rights Reserved.

Privacy Policy | Terms and Conditions
Job Interview Questions | Placement Papers | Free SMS | Freshers Jobs | MBA Forum | Learn SAP | Web Hosting