Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting object reference error if i run QTP script
#3
Not Solved
Hi Saket,
This is my recorded script. While running at last if QTP clicks on finish button then getting the error. But manually if i run it application not throwing error. I am also attaching the screen shots for the wizard. In the results page we are not entering any thing just clicking on finish only.

Recorded QTP Script
Code:
SwfWindow("ITKK.NET").SwfTreeView("tvITKKTree").Select "AutoCustomer-3-Feb-2010;test compressor class 2.1;1st Stage", micRightBtn
SwfWindow("ITKK.NET").SwfToolbar("SwfToolbar").Select "Operating Condition Wizard"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfEdit("txtOCName1").Set "Design"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfEdit("txtSuctionPressure1").Set "1.03"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfEdit("txtDischargePressure1").Set "3.90"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfEdit("txtSuctionTemperature1").Set "-90"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfButton("Next").Click
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfEdit("txtGasAnalysisName2").Set "methane"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfEdit("txtGasAnalysisName2").Type  micTab
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfEdit("txtHumidity2").Type  micTab
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfComboBox("cmbHumidity2").Type  micTab
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfTable("dgvGases").SelectCell 93,"Gas Name"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfButton("btnAdd").Click
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfTable("dgvSelectedGases").SelectCell 1,"Proportion"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfTable("dgvSelectedGases").SetCellData 1,"Proportion","90"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfTable("dgvGases").SelectCell 119,"Gas Name"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfTable("dgvSelectedGases").SelectCell 2,"Gas Name"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfTable("dgvSelectedGases").SelectCell 2,"Proportion"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfTable("dgvSelectedGases").SetCellData 2,"Proportion","10"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfButton("Next").Click
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfButton("Finish").Click


Even i modified the script as like below. But no use. Tabhits is just a small function contains for loop.

Code:
Set WshShell = CreateObject("WScript.Shell")
Public Function TabHits(i)
       For j = 1 to i
            WshShell.SendKeys "{TAB}"
       Next
End Function


Code:
SwfWindow("ITKK.NET").Activate
SwfWindow("ITKK.NET").SwfTreeView("tvITKKTree").Select "AutoCustomer-3-Feb-2010;test compressor class 2.1;1st Stage"
SwfWindow("ITKK.NET").SwfTreeView("tvITKKTree").Select "AutoCustomer-3-Feb-2010;test compressor class 2.1;1st Stage", micRightBtn
SwfWindow("ITKK.NET").SwfToolbar("CMSOpen").ShowDropdown "Wizards"
SwfWindow("ITKK.NET").SwfToolbar("CMSOpen").Select "Wizards;Operating Condition Wizard"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfEdit("txtOCName1").Set "Design"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfEdit("txtSuctionPressure1").Set "1.03"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfEdit("txtDischargePressure1").Set "3.90"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfEdit("txtSuctionTemperature1").Set "-90"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfButton("Next").Click
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfEdit("txtGasAnalysisName2").Set "methane"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfTable("dgvGases").SelectCell 0,"Formula"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfTable("dgvGases").SelectCell 93,"Gas Name"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfButton("btnAdd").Click
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfTable("dgvSelectedGases").SelectCell 1,"Proportion"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfTable("dgvSelectedGases").SetCellData 1,"Proportion","90"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfTable("dgvGases").SelectCell 119,"Gas Name"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfButton("btnAdd").Click
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfTable("dgvSelectedGases").SelectCell 2,"Proportion"
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfTable("dgvSelectedGases").SetCellData 2,"Proportion","10"
wait(3)
SwfWindow("ITKK.NET").SwfWindow("Operating Condition").SwfButton("Next").Click
wait(3)
Call TabHits(21)
wait(2)
WshShell.SendKeys "{ENTER}"

Hi Saket i am also attaching the screen shots for the same.


Attached Files Image(s)
   
Reply


Messages In This Thread
RE: Getting object reference error if i run QTP script - by nistalaramesh - 02-05-2010, 12:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  General run error when Exist fails msacks 1 1,806 02-08-2019, 02:12 AM
Last Post: Ankur
  Pass reference to datatable into function smallsteve 2 2,019 09-28-2017, 09:18 PM
Last Post: smallsteve
  How to run multiple iterations only on a set of lines in script amit25007 0 2,406 05-17-2016, 10:48 AM
Last Post: amit25007
  General Object Error(Find Object Error) akhandesh 1 3,515 02-24-2016, 01:05 PM
Last Post: sindhus
Rolleyes The test run cannot continue due to an unrecoverable error neerndg123 3 8,581 09-17-2015, 08:27 PM
Last Post: ananthakumarbe

Forum Jump:


Users browsing this thread: 1 Guest(s)