Forum Discussion
14 years ago
> In my experience, when a link or item on a page is scrolled off screen, when I make the call to "click" on it, my web browser automatically scrolls.
That was initially also my experience, until I needed to click a link in a scrollable box that was just scrolled off the visible box..that always gave me the "There was an attempt to perform an action at point (50, 6) which is invisible or out of the window bounds." error. Other items further scrolled off the visible box had no problem with the Click method. I saw that the difference in behavior is related to the value of the VisibleOnScreen property. When it is False, then the item is automatically scrolled into the visible area and then clicked, but when it is wrongly True (it really is not visible on screen), then I will get this error.
My workaorund: before a click on the object, I make sure the object is scrolled into the visible box, like this:
Sub Click_MainMenuBar(MenuItem)
'Simulates a left-button single click in a window or control as specified (relative position, shift keys).
PropNames = Array("ObjectType","innerText")
PropValues = Array("TextNode",MenuItem)
Set MenuItemObj = Aliases.IEXPLORE.pageCustomerCareApplicationVersi....etc...panelTMnmenutrwpmntr.Find(PropNames, PropValues, 10, True)
'Lets make sure MenuItem is visible on screen (scroll) before doing a Click (some items have property VisibleOnScreen = True, while they are NOT visible on screen)
panelTMnmenutrwpmntrTop = Aliases.IEXPLORE.pageCustomerCareApplicationVersi...etc...panelTMnmenutrwpmntr.Top
panelTMnmenutrwpmntrScrollTop = Aliases.IEXPLORE.pageCustomerCareApplicationVersi...etc...panelTMnmenutrwpmntr.scrollTop
Aliases.IEXPLORE.pageCustomerCareApplicationVersi...etc...panelTMnmenutrwpmntr.scrollTop = panelTMnmenutrwpmntrScrollTop + MenuItemObj.Top - panelTMnmenutrwpmntrTop
MenuItemObj.Click
End Sub
That works for me
That was initially also my experience, until I needed to click a link in a scrollable box that was just scrolled off the visible box..that always gave me the "There was an attempt to perform an action at point (50, 6) which is invisible or out of the window bounds." error. Other items further scrolled off the visible box had no problem with the Click method. I saw that the difference in behavior is related to the value of the VisibleOnScreen property. When it is False, then the item is automatically scrolled into the visible area and then clicked, but when it is wrongly True (it really is not visible on screen), then I will get this error.
My workaorund: before a click on the object, I make sure the object is scrolled into the visible box, like this:
Sub Click_MainMenuBar(MenuItem)
'Simulates a left-button single click in a window or control as specified (relative position, shift keys).
PropNames = Array("ObjectType","innerText")
PropValues = Array("TextNode",MenuItem)
Set MenuItemObj = Aliases.IEXPLORE.pageCustomerCareApplicationVersi....etc...panelTMnmenutrwpmntr.Find(PropNames, PropValues, 10, True)
'Lets make sure MenuItem is visible on screen (scroll) before doing a Click (some items have property VisibleOnScreen = True, while they are NOT visible on screen)
panelTMnmenutrwpmntrTop = Aliases.IEXPLORE.pageCustomerCareApplicationVersi...etc...panelTMnmenutrwpmntr.Top
panelTMnmenutrwpmntrScrollTop = Aliases.IEXPLORE.pageCustomerCareApplicationVersi...etc...panelTMnmenutrwpmntr.scrollTop
Aliases.IEXPLORE.pageCustomerCareApplicationVersi...etc...panelTMnmenutrwpmntr.scrollTop = panelTMnmenutrwpmntrScrollTop + MenuItemObj.Top - panelTMnmenutrwpmntrTop
MenuItemObj.Click
End Sub
That works for me
Related Content
Recent Discussions
- 4 hours ago