Ask a Question

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

salley
Frequent Contributor

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 6
Marsha_R
Community Hero

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

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


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
salley
Frequent Contributor

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

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
Community Hero

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

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.


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
salley
Frequent Contributor

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

i want to click the link ,,, when i use the Image object it works fine ,, 

Marsha_R
Community Hero

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

That's fine.  It's still a good idea to record a test and click on the link and compare what TC gives you there to what you are doing in the function.  


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
salley
Frequent Contributor

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

yeah i'll do that and will let you know,, thanks

cancel
Showing results for 
Search instead for 
Did you mean: