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
endorium
Frequent Contributor

Still trying. Its becoming very frustrating

 

Tried the below to find and click the button validate. Again if not visible on screen it does not work. If its visible it does work. If I add the scrollintoview again it says it is not supported. Surely such a simple thing cannot be this difficult? Imust be missing something simple?

 

 

function ClickByButtonText(/*buttonVisibleText*/)
{
var buttonVisibleText = "VALIDATE"
/* convert String to object */
var buttonText = ConvertToObject(buttonVisibleText);

//Waits upto 10 seconds for page to load
Sys.Browser("*").Page("*").Wait("10000");

waitUntilObjectIsVisible("//button[contains(text(),'" + buttonText + "')]");
var page = Sys.Browser("*").Page("*")
page.FindChild("contentText", buttonText, 500).Click();
}

tristaanogre
Esteemed Contributor

What is "ConvertToObject" doing?  If you're using FindChild, the parameter buttonText needs to be a string, not an object.

 

Try just the following.  Let's not get any fancier than we need to.

function ClickByButtonText()
{
var buttonVisibleText = "VALIDATE"


Sys.Browser("*").Page("*").Wait("10000");

var page = Sys.Browser("*").Page("*")
var mybutton = page.FindChild("contentText", buttonText, 500)
if (myButton.Exists){
    myButton.scrollIntoView(true);
    myButton.Click();
}
}

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: