Skip to main content

Posts

Showing posts from May, 2010

QTP-Stroring Environment Variable In XML File

Objective:Login Action Parameterization By the Use of External Environment Variables the issue of Login Actions parameterization could be solved.Using this approach we can concurrently run scripts on different environments. How it Works: 1. Create AutomaticConfiguration.xml file with two variables namely AdminLogin,UserLogin in Local QTP Installation folder. 2. The Admin and User Login Actions Loads the AutomaticConfiguration.xml file from the above mentioned path. 3. The Login Actions use the Environment variables to Launch the Application. Steps To Create an XML File: 1. Open Notepad. 2. Type ENVIRONMENT on the first line (in opening and closing angular brackets) 3. Type each variable name-value pair within variable elements in the following format: For example, your environment variables file may look like this: 4. Save the file as AutomaticConfiguration.xml in quicktest install folder (\program Files\MercuryInteractive\QuickTestProfessional) in your Local Machine. You are d

QTP Functions

QTP Functions ********************************************************************************** Function TimeStamp() iArr1=Replace(Now,"/","") iArr2=Replace(iArr1,":","") iArr3=Replace( iArr2,"AM","") iArr3=Replace( iArr2,"PM","") iArr4=Replace(iArr3," ","") iArr5=Cdbl(iArr4) iTimeStamp=iArr5-1000000000 TimeStamp=iTimeStamp End Function ********************************************************************************** Function TimeStamp(theDate) TimeStamp=DateDiff("s","01/01/1970 00:00:00",theDate) End function ********************************************************************************** How to use the below function in your Test Script ********************************************************************************** Set oObj=Browser("oBrowser").Page("oPage").Frame("oFrame").WebTable("oWebTable") Call