Ask a Question

There was an attempt to perform an action at a point, which is beyond the screen

endorium
Frequent Contributor

There was an attempt to perform an action at a point, which is beyond the screen

Getting the above issue which I have seen has been seen before but those resolutions are not working for me.

It an AngularJS web app. Most objects in the page only support 'click' or 'keys'

 

This means things like 'scrolltoview/scrolltoviewifneeded' do not work and I get 'this object does not support this'.

 

Any ideas how I can get the page to scroll because if I get it to select a button that is off the visible view I get the error message "There was an attempt to perform an action at a point, which is beyond the screen"

11 REPLIES 11
AlexKaras
Champion Level 2

Hi,

 

> things like 'scrolltoview/scrolltoviewifneeded

The method is called scrollIntoView(true/false) and is supported by all browsers.

Regards,
  /Alex [Community Champion]
____
[Community Champions] 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 Champions]
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 Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
endorium
Frequent Contributor

If I use scrollintoview I get the message that it is not supported by the object.

I presumed this is because when I spy the object it only supports methods 'click' and 'keys'?

 

Am I missing something?

tristaanogre
Esteemed Contributor

Case sensitivity...  depending upon your scripting language, you HAVE to reference the method as scrollIntoView.  


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
endorium
Frequent Contributor

I am using Javascript.

No matter the case sensitivity I use I get the same message : "Object doesn't support this property or method"

tristaanogre
Esteemed Contributor

Interesting.  One option is to do a check of "VisibleOnScreen'.  If that returns false, send a PageDown keystroke to your page object.

 

I'm curious, though... as mentioned, scrollIntoView is pretty globally supported for any UI elements on a web page.  Can you post a) the code that you're attempting to execute the scrollIntoView on and b) screenshots of the Advanced properties and methods on your object?


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
endorium
Frequent Contributor

function ClickByXpath(xPathTemp)
{

/* convert String to object */
var xPath = ConvertToObject(xPathTemp);

//Waits upto 10 seconds for page to load
Sys.Browser("*").Page("*").Wait("10000");
xPath.scrollIntoViewIfNeeded()
waitUntilObjectIsVisible(""+ xPath + "");
Sys.Browser("*").Page("*").FindChildByXPath(xPath).Click();

tristaanogre
Esteemed Contributor

Methods Advanced View too, please?  scrollIntoView is not a "Standard" method or an Action.

 

I THINK I might know what's going on but I'm not sure... it has to do with finding objects by xPath... you're not necessarily going to find exactly the object that is an onscreen component which means it might not fully support everything that would typically be supported.  

 

What if you change that link where you're calling "Click" to assign the result of the "find" to a variable.  Drop a breakpoint then, in your code, and investigate that result to see what it actually returns.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
endorium
Frequent Contributor

Attached the advanced property which does say it supports  scrollintoview.

The xPath i use only finds the one object on the page which is unique.

You think finding it by class or another way may work?

tristaanogre
Esteemed Contributor

As mentioned above, finding via xPath returns not a TestComplete object which put all sorts of wrappers and such around it but the straight DOM object from the page... so the result of FindChildByXPath may find the correct object... but it's not an object with everything exposed as you would with a straight FindChild or with a mapped object.  

 

If you use FindChild, you might have better luck.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
cancel
Showing results for 
Search instead for 
Did you mean: