Clicking On Consecutive Cells

Class library usage, coding and language questions.
Christian Dabnor
Posts: 9
Joined: Thu Apr 06, 2017 10:59 am

Clicking On Consecutive Cells

Post by Christian Dabnor » Mon Oct 16, 2017 12:46 pm

In the software I'm testing, we have a diary section which is built up of a grid. I need to test if it is capable of accepting 999 'bookings'. As you can imagine, I'd like to avoid doing these manually! However, when I record a click, the Ranorex code just contains the cell, as opposed to the table it is part of. The code I have written, which doesn't work, is below. I'm new to C# development, just learning here and there in order to supplement my tests. Thank you in advance for any assistance you may be able to provide.

Code: Select all

public void Mouse_Click_Row0Column0()
{
    {
        {
            int intBookings = 0;
            //The below lines are a bit clumsy, but starts it all off at row 0, column 0
            int intRow = -1;
            int intColumn = -1;
            while (intBookings < 1000)
            {
                {
                    intRow += 1;
                    //Each column is 7 columns across
                    while (intColumn < 7)
                    {
                        intColumn += 1;
                        repo.ReceptionMainForm.FlexGrid.Cells[intRow, intColumn].click;
                    }
                }
            }
        }
    }
}

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Clicking On Consecutive Cells

Post by odklizec » Mon Oct 16, 2017 1:52 pm

Hi,

Please upload a Ranorex snapshot (not screenshot!) of the table/grid in question, so we can see the structure of the table and cells and validate/optimize your code. Thanks.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Christian Dabnor
Posts: 9
Joined: Thu Apr 06, 2017 10:59 am

Re: Clicking On Consecutive Cells

Post by Christian Dabnor » Mon Oct 16, 2017 2:06 pm

Thank you for your quick response. The image is below. The grid refers to availability within a timeslot.
Capture.JPG
You do not have the required permissions to view the files attached to this post.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Clicking On Consecutive Cells

Post by odklizec » Mon Oct 16, 2017 2:12 pm

Hi,

I'm afraid, what you have posted is a screenshot, not snapshot. Screenshot is unfortunately not helpful here. Please learn how to create snapshot here:
http://www.ranorex.com/support/user-gui ... files.html
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Christian Dabnor
Posts: 9
Joined: Thu Apr 06, 2017 10:59 am

Re: Clicking On Consecutive Cells

Post by Christian Dabnor » Mon Oct 16, 2017 2:26 pm

Sorry. Totally misread that. By following the instructions on generating the snapshot, and as a result, using Spy for the first time, however, I can see more clearly how to do what I need to do. Thank you very much for your help.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Clicking On Consecutive Cells

Post by odklizec » Mon Oct 16, 2017 3:03 pm

You are welcome. Nice to hear you figured it out ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration