SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Apr 2006
    Location
    US
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Can anyone correct this General Run Error

    I'm able to get the count correctly.

    But I get a GENERAL RUN ERROR WHEN from the second iteration in the loop. Tried to get the error number ( -2147467259).

    Your inputs are greatly appreciated.

    Set oDesc = Description.Create
    oDesc("micclass").Value ="Image"
    oDesc("file name").Value ="ZTN_Minimize.gif"
    Set Images = Browser("xxx").Page("xxx").Frame("Left").ChildObje cts(oDesc)

    NumImages = Images.Count
    Msgbox NumImages

    For t = 0 to NumImages-1
    If Images(t).GetROProperty("file name") ="ZTN_Minimize.gif" Then
    Images.Item(t).Click
    End If
    Next
    Set Images = Nothing
    What say you?

  2. #2
    Member
    Join Date
    Apr 2008
    Location
    New York, USA
    Posts
    133
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can anyone correct this General Run Error

    Include

    If Not Images is Nothing Then

    ---------------
    your steps
    ---------------

    End If

  3. #3
    Advanced Member Anshoo Arora's Avatar
    Join Date
    Oct 2007
    Location
    New Delhi, India
    Posts
    635
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can anyone correct this General Run Error

    You can creating a description object for an Image object with the file name: "ZTN_Minimize.gif". But, why are you verifying it in the loop? I know its not going to cause an error but don't you think its redundant?

    You can simply do the following:

    <font class="small">Code:</font><hr /><pre>
    Set oDesc = Description.Create
    oDesc("micclass").Value ="Image"
    oDesc("file name").Value ="ZTN_Minimize.gif"
    Set Images = Browser("xxx").Page("xxx").Frame("Left").ChildObje cts(oDesc)

    NumImages = Images.Count
    Msgbox NumImages

    For t = 0 to NumImages - 1
    If Images(t).Exist( 1 ) Then
    Images(t).Highlight
    End If
    Next

    Set Images = Nothing
    </pre><hr />

    Also, when you click the first image, does the page navigate to another page? If that's true, you will have to work a mechanism to navigate backwards each time.
    Regards,

    Anshoo Arora
    Relevant Codes

  4. #4
    Senior Member
    Join Date
    Jun 2007
    Location
    IL, US
    Posts
    408
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can anyone correct this General Run Error

    Exit For?

  5. #5
    Junior Member
    Join Date
    Apr 2006
    Location
    US
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can anyone correct this General Run Error

    Thanks MOBIN, "Is Nothing" is working fine. However, any breakpoints( for debugging) in the loop still throws the error.

    Anshoo,this is an image button with minimize / maximize feature. There are about 25 of them on the page. I'm planning to create one loop inside the one posted below to get the Links count.

    Exit for ......... not sure whether it will click all Images. Tired it, it didn't

    Thanks all for your help.

    *******************************************
    Set oDesc = Description.Create
    oDesc("micclass").Value = "Image"
    oDesc("file name").Value = "BTN_Minimize.gif"

    Set Images =Browser("xxx").Page("xxx").Frame("Left").ChildObj ects(oDesc)
    NumImages = Images.Count
    msgbox Images.Count
    For im = 0 to Images.Count-1
    If Not Images is Nothing Then
    If Images.item(im).GetRoProperty("file name") = "BTN_Maximize.gif" then
    Elseif not Images is Nothing Then
    images.item(im).Click
    End if
    End If
    Next
    Set Images = Nothing
    ********************************************
    What say you?

  6. #6
    Advanced Member Anshoo Arora's Avatar
    Join Date
    Oct 2007
    Location
    New Delhi, India
    Posts
    635
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can anyone correct this General Run Error

    Try this:

    <font class="small">Code:</font><hr /><pre>
    Set oDesc = Description.Create
    oDesc("micclass").Value = "Image"
    oDesc("file name").Value = "BTN_Minimize.gif"

    Set Images =Browser("xxx").Page("xxx").Frame("Left").ChildObj ects(oDesc)
    NumImages = Images.Count
    msgbox Images.Count

    For im = 0 to Images.Count - 1
    If Images(im).Exist(1) Then
    Images(im).Init
    Images(im).Click
    End If
    Next

    Set Images = Nothing
    </pre><hr />
    Regards,

    Anshoo Arora
    Relevant Codes

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.00%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 08:14 AM.

Copyright BetaSoft Inc.