Forum Discussion

kish's avatar
kish
Contributor
14 years ago

There was an attempt to perform an action at point, which out of the window bounds

Hi,



I am trying to do DDT for radio button through excel.

There are three options with radio button, i need to select one option in each iteration and other two options are not selected.

Mentioned sample script below. If i run the below script, i am getting the below error at

Perpupilprice.Click(Drivera.Value("Per pupil price"));



There was an attempt to perform an action at point (0,-1), which out of the window bounds .



The window size is (20, 20); screen rectangle: the left top corner is (1022, 714), the right bottom corner is (1041, 733).

The screen coordinates of the point is (1022, 713).

I have checked in the forums , but i didn't find a solution.



Please help , how to resolve?



//Price by band

        pricebyband.Click(Drivera.Value("Price by band"));

   

// Per puipl price

   Perpupilprice.Click(Drivera.Value("Per pupil price"));

 

//Per unit price

   Perunitprice.Click(Drivera.Value("Per unit price"));



Excel data:



























Price by
band
per unit price Per pupil price
TRUE FALSE FALSE
FALSE TRUE FALSE
FALSE FALSE TRUE





Thanks and Regards,

Kish
  • Hi,



    Click has three parameters - coordinates and the pressed 'shift' keys (see the Click Action help topic). You pass a single boolean value to it - this is incorrect.
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    If you want to get it to check on a particular radio button based upon the value in the Excel, I'd do the following:



    /Price by band

    if (VarToBool(Drivera.Value("Price by band")))

    {

            pricebyband.Click();

    }

    if (VarToBool(Drivera.Value("Per pupil price")))

    {

       Perpupilprice.Click(); 

    }  

    if (VarToBool(Drivera.Value("Per unit price")))

    {

       Perunitprice.Click(); 

    }




    In my practical experience, though, I think most radio button controls actually map with a ClickButton method as well in which case all the "Click" calls in the above code could be replaced with ClickButton