andygough1974
10 years agoNew Contributor
Changing screen layout slightly changes coordinates, tests fail
Hi All
I have a WPF application with a charting window in it, in this window are certain "Grips" which I can drag around the chart and it will draw best fitting lines etc.
I recorded the test as a keyword and converted to script and got the follwoing function:
function FreqResp_LPF_1000Hz()
{
//Clicks the 'ButtonDefault' button.
//Drags from point (69, 250) of the 'Polygon' object to offset (-2, -164).
//Drags from point (210, 246) of the 'EqPlot' object to offset (145, -160).
//Drags from point (354, 248) of the 'Path' object to offset (147, -163).
Aliases.VEParameterTool.HwndSource_LvTuningTool.LvTuningTool.ScrollViewer.DockPanel.DockPanel.tabControlMainTab.EQControl.EqTabs.DockPanel.DockPanel.Border.StackPanel.StackPanel.ButtonDefault.ClickButton();
Aliases.VEParameterTool.HwndSource_LvTuningTool.LvTuningTool.ScrollViewer.DockPanel.DockPanel.tabControlMainTab.EQControl.EqTabs.DockPanel.Grid.EqPlot.Canvas.Polygon.Drag(69, 250, -2, -164);
Aliases.VEParameterTool.HwndSource_LvTuningTool.LvTuningTool.ScrollViewer.DockPanel.DockPanel.tabControlMainTab.EQControl.EqTabs.DockPanel.Grid.EqPlot.Drag(210, 246, 145, -160);
Aliases.VEParameterTool.HwndSource_LvTuningTool.LvTuningTool.ScrollViewer.DockPanel.DockPanel.tabControlMainTab.EQControl.EqTabs.DockPanel.Grid.EqPlot.Canvas.Path.Drag(354, 248, 147, -163);
}
Now that works fine, but i found a small thing in my layout that wasnt right and had to change the size of another UI element, which slightly changed the position of the chart, and now this test fails because it cant find the object its looking for.
The exact error is:
There was an attempt to perform an action at point (354, 248) which is invisible or out of the window bounds.
And the Additional Info is:
Tested object:
Aliases.VEParameterTool.HwndSource_LvTuningTool.LvTuningTool.ScrollViewer.DockPanel.DockPanel.tabControlMainTab.EQControl.EqTabs.DockPanel.Grid.EqPlot.Canvas.Path
(Sys.Process("VEParameterTool").WPFObject("HwndSource: LvTuningTool").WPFObject("LvTuningTool").WPFObject("ScrollViewer", "", 1).WPFObject("DockPanel", "", 1).WPFObject("DockPanel", "", 1).WPFObject("tabControlMainTab").WPFObject("EQControl", "", 1).WPFObject("EqTabs").WPFObject("DockPanel", "", 1).WPFObject("Grid", "", 1).WPFObject("EqPlot").WPFObject("Canvas", "", 1).WPFObject("Path", "", 13))
Also, I have attached a picture top show you the "Grips" I can no longer access (I made the UC on the right huge to show the issue), therte are 4 "Grip Points" labeled in Black.
Does anyone have any idea how i can fix my tests so that small UI changes dont break my tests?
Many thanks in advace
I have a WPF application with a charting window in it, in this window are certain "Grips" which I can drag around the chart and it will draw best fitting lines etc.
I recorded the test as a keyword and converted to script and got the follwoing function:
function FreqResp_LPF_1000Hz()
{
//Clicks the 'ButtonDefault' button.
//Drags from point (69, 250) of the 'Polygon' object to offset (-2, -164).
//Drags from point (210, 246) of the 'EqPlot' object to offset (145, -160).
//Drags from point (354, 248) of the 'Path' object to offset (147, -163).
Aliases.VEParameterTool.HwndSource_LvTuningTool.LvTuningTool.ScrollViewer.DockPanel.DockPanel.tabControlMainTab.EQControl.EqTabs.DockPanel.DockPanel.Border.StackPanel.StackPanel.ButtonDefault.ClickButton();
Aliases.VEParameterTool.HwndSource_LvTuningTool.LvTuningTool.ScrollViewer.DockPanel.DockPanel.tabControlMainTab.EQControl.EqTabs.DockPanel.Grid.EqPlot.Canvas.Polygon.Drag(69, 250, -2, -164);
Aliases.VEParameterTool.HwndSource_LvTuningTool.LvTuningTool.ScrollViewer.DockPanel.DockPanel.tabControlMainTab.EQControl.EqTabs.DockPanel.Grid.EqPlot.Drag(210, 246, 145, -160);
Aliases.VEParameterTool.HwndSource_LvTuningTool.LvTuningTool.ScrollViewer.DockPanel.DockPanel.tabControlMainTab.EQControl.EqTabs.DockPanel.Grid.EqPlot.Canvas.Path.Drag(354, 248, 147, -163);
}
Now that works fine, but i found a small thing in my layout that wasnt right and had to change the size of another UI element, which slightly changed the position of the chart, and now this test fails because it cant find the object its looking for.
The exact error is:
There was an attempt to perform an action at point (354, 248) which is invisible or out of the window bounds.
And the Additional Info is:
Tested object:
Aliases.VEParameterTool.HwndSource_LvTuningTool.LvTuningTool.ScrollViewer.DockPanel.DockPanel.tabControlMainTab.EQControl.EqTabs.DockPanel.Grid.EqPlot.Canvas.Path
(Sys.Process("VEParameterTool").WPFObject("HwndSource: LvTuningTool").WPFObject("LvTuningTool").WPFObject("ScrollViewer", "", 1).WPFObject("DockPanel", "", 1).WPFObject("DockPanel", "", 1).WPFObject("tabControlMainTab").WPFObject("EQControl", "", 1).WPFObject("EqTabs").WPFObject("DockPanel", "", 1).WPFObject("Grid", "", 1).WPFObject("EqPlot").WPFObject("Canvas", "", 1).WPFObject("Path", "", 13))
Also, I have attached a picture top show you the "Grips" I can no longer access (I made the UC on the right huge to show the issue), therte are 4 "Grip Points" labeled in Black.
Does anyone have any idea how i can fix my tests so that small UI changes dont break my tests?
Many thanks in advace