cancel
Showing results for 
Search instead for 
Did you mean: 

Mouse click not proper

SOLVED
Researcher
New Contributor

Mouse click not proper

I am using Test complete for desktop application testing.

While recording  in the grid view, click on particular cell and edited the value. But Playback is run It is selecting different cell.

how to  make it  click on proper cell and edit the value.

1 ACCEPTED SOLUTION

Accepted Solutions
zarcher
Occasional Contributor

Re: Mouse click not proper

I was able to solve this issue by using the page down key. In my example the grid value I needed to edit was at the bottom of the page. I paged down until the value was in view and then made the edit. This allowed the grid in view to have the exact same setup every time. Only problem with this is if the grid changes (values added or removed) you will need to update your script.

View solution in original post

5 REPLIES 5
anupamchampati
Frequent Contributor

Re: Mouse click not proper

Use this function to click on Grid, just modify a little bit according to the property of your grid
I have posted the overview of clickGrid function .

Para 1 : Grid - Object of the Grid
Para 2: Column name you want to click in
Para 3 : Cell Value to click 
function ClickGrid(Grid,Column,Value)
{
var RowIndex;
function FindRow(Grid, Column, Value, ViewId)
{
if (typeof(ViewId) == "undefined")
ViewId = 0;
for (var i=0; i<Grid.wRowCount(ViewId); i++)
if (Grid.wValue(i, Column, ViewId) == Value)
return i;
return -1;
}
RowIndex = FindRow(Grid,Column,Value);
if (RowIndex != -1)
{
Grid.ClickCell(RowIndex, Column);
Log.Message("Row index: " + RowIndex + " Column Name: " + Value);
}
else
Log.Error("Row was not found");
}

Researcher
New Contributor

Re: Mouse click not proper

Mouse click problem occurs only in flex grid.

For the data grid in the application scroll bar set and mouse click correctly click the grid cell
But for the Flex grid in the application the scroll bar is set ,grid is unchanged and mouse click for different cell.

For the data grid unit script have this:
WindowsForms10Window8app0141b42ar11ad1.MouseWheel(-11)

And for Flex grid the unit script is :
VBFlexGridWndClass.VScroll.Pos = 6

How can this be solved?

zarcher
Occasional Contributor

Re: Mouse click not proper

I was able to solve this issue by using the page down key. In my example the grid value I needed to edit was at the bottom of the page. I paged down until the value was in view and then made the edit. This allowed the grid in view to have the exact same setup every time. Only problem with this is if the grid changes (values added or removed) you will need to update your script.

View solution in original post

sonya_m
Community Manager

Re: Mouse click not proper

@zarcher thank you for sharing your solution! This will potentially help a lot of people!


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
kingdong
New Contributor

Re: Mouse click not proper

Thanks for the help i have been facing smilier issue,

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors