Hello Team/ Karthik:
We (myself and a friend both QTP premium members) are trying to follow the video recorded video 04-08 DDF (26:00 min approx) on our own. So we wrote our own code with slightly different names of objects.
We were trying to put into action the Set system of object creation. However the code stops at this line:
Set myP = Browser("IE").Page("Page 1") (Shown in bold below.)
I get the following error message: "variable is undefined 'myP'
However, it WORKS when we take Option Explicit off?
Can someone tell us what's going on?
Option ExplicitDim vCost, vEndMiles, vStartMiles, vMileGallonsDim vURLvCost = 4vEndMiles = 80000 vStartMiles = 60000 vMileGallons = 100 vURL = "http://www.calculator.net/gas-mileage-calculator.html"'Browser("IE").Page("Page 1").WebEdit("EndMiles").Set vEndMiles'Browser("IE").Page("Page 1").WebEdit("StartMiles").Set vStartMiles'Browser("IE").Page("Page 1").WebEdit("Cost").Set vCost'Browser("IE").Page("Page 1").WebEdit("Mile_Gallons").Set vMileGallonsSystemutil.Run("iexplore.exe"), vURLSet myP = Browser("IE").Page("Page 1") CODE DOES NOT EXECUTE HEREmyP.WebEdit("EndMiles").Set vEndMilesmyP.WebEdit("StartMiles").Set vStartMilesmyP.WebEdit("Cost").Set vCostmyP.WebEdit("Mile_Gallons").Set vMileGallons