Micro Focus QTP (UFT) Forums
Getting General Run Error - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Getting General Run Error (/Thread-Getting-General-Run-Error)



Getting General Run Error - suresh vasu - 01-05-2012

Hi, I am getting Getting "General Run Error" exception when executing below code

Code:
1. For intObjectFound = 0 to Frame_ShipmentPage.Count
2.  Set WebElement_ActionBtn = Frame_ShipmentPage(intObjectFound).ChildObjects(ActionDesc)
3. If WebElement_ActionBtn.Count <> 0 Then
4.    Exit For
5. End If
6. Next

Getting error at line 2, I have verified all the properties of defined objects everything is ok in that part. Object descrition below for your ref.
----------
Code:
Set FrameDesc = description.Create
FrameDesc("micclass").Value = "Frame"
FrameDesc("html id").Value = "ext-gen.*"

set Frame_ShipmentPage =  obj_page_Welcome.ChildObjects(FrameDesc)
--------
Set ActionDesc = description.Create
ActionDesc("micclass").Value = "WebElement"
ActionDesc("innertext").Value = "Actions"
ActionDesc("class").Value = " x-btn-text|buttontext"
---------------
Normally what are the situations we get General Run Error.

Thanks in advance.

Suresh.


RE: Getting General Run Error - sundari_msls - 01-05-2012

Code:
For intObjectFound = 0 to Frame_ShipmentPage.Count
   Set WebElement_ActionBtn = Frame_ShipmentPage(intObjectFound).ChildObjects(ActionDesc)
   If WebElement_ActionBtn.Count <> 0 Then
      Exit For
   End If
Next

In the above loop, the array base in dex will be 0. so the maximum value should be Frame_ShipmentPage.Count-1.

Code:
For intObjectFound = 0 to Frame_ShipmentPage.Count-1



RE: Getting General Run Error - suresh vasu - 01-05-2012

Thanks for the reply, and it worked there but now the sameerror is coming at below line Sad

Code:
Set WebElement_ActionButton =  WebElement_ActionBtn(0)
WebElement_ActionButton.Click

Pease help


RE: Getting General Run Error - suresh vasu - 01-05-2012

Its working fine now, there was a problem with Frame object property.

Thanks all.