Forum Discussion

salley's avatar
salley
Frequent Contributor
7 years ago

Trying to click a link- There was an attempt to perform an action on a zero-sized window.

Hi,

I'm trying to click a link, not sure why i'm getting this error, could this be a reason because VisibleOnScreenis set to False?

Below is my Code:

Function CheckObjectExist(sPage,arrProp,arrVal)
Set myObj=sPage.FindChild(arrProp,arrVal,50)
i=0
Do While Not (myObj.Exists) and i<5
aqUtils.Delay(1000)
Set myObj=sPage.FindChild(arrProp,arrVal,50)
i=i+1
Loop
If (myObj.Exists) Then
Set CheckObjectExist=myObj
Else
log.Error "Object is not Found"
End If
End Function

,calling this function from another function

 

Function ClickNewQuote
Set sPage=Aliases.browser.MainPage
LinkCreateNewQuoteProp=Array("namePropStr","ObjectIdentifier","ObjectType")
LinkCreateNewQuotePropVal=Array("Login","LinkAnchor","Link")
Set LinkCreateNewQuote=CheckObjectExist(sPage,LinkCreateNewQuoteProp,LinkCreateNewQuotePropVal)
If (LinkCreateNewQuote.exists) Then
log.Message"objectfound"
LinkCreateNewQuote.Click
End If
End Function

' any help would be highly appreciated,, pls see the screen shot

 

 

 

 

6 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    It could be, but what is your function returning?  Are you getting your "object not found" message or does your code see the object?

    • salley's avatar
      salley
      Frequent Contributor

      Returning object found,,,,,,,,,,its just not clicking the item.

      objectfound 
      There was an attempt to perform an action on a zero-sized window

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        Try recording a test where you click on that object and make sure that the object that TC sees when you do that and the name that you derive in your function are the same.  Your derived object might not be the one you are intending to click.