Requirement:
On WPF application I need to scroll down( vertical) and until an element is visible. Once I element is visible , I stop (later I need to click on it)
Issue 1:
I recorded below script using SilkTest workbench but when I run/replay the script , it only moves the right scroll bar and does not move the screen.
When I recorded the script the screen moved along with the scrollbar.
ScrollBar screenshot
Public Module Main
Dim _desktop As Desktop = Agent.Desktop
Dim _desktop As Desktop = Agent.Desktop
Public Sub Main()
With _desktop.WPFWindow("ABCD")
.SetActive()
' Converted 'PressMouse' to 'Click' because no matching 'ReleaseMouse' was found
.WPFFrameworkElement("TabGridView").Click(MouseButton.Left, New Point(832, 2))
.Size(1045, 728)
' Removed 'ReleaseMouse' because no matching 'PressMouse' was found
.WPFScrollBar("VerticalScrollBar").SetValue(202.40963855421685)
.WPFScrollBar("VerticalScrollBar").SetValue(355.6626506024096)
.WPFScrollBar("VerticalScrollBar").SetValue(413.49397590361446)
.WPFScrollBar("VerticalScrollBar").SetValue(462.6506024096386)
.WPFScrollBar("VerticalScrollBar").SetValue(569.6385542168674)
.WPFScrollBar("VerticalScrollBar").SetValue(711.3253012048193)
.WPFScrollBar("VerticalScrollBar").SetValue(864.578313253012)
.WPFScrollBar("VerticalScrollBar").SetValue(1009.156626506024)
.WPFScrollBar("VerticalScrollBar").SetValue(1065.0)
End With
End Sub
End Module
With _desktop.WPFWindow("ABCD")
.SetActive()
' Converted 'PressMouse' to 'Click' because no matching 'ReleaseMouse' was found
.WPFFrameworkElement("TabGridView").Click(MouseButton.Left, New Point(832, 2))
.Size(1045, 728)
' Removed 'ReleaseMouse' because no matching 'PressMouse' was found
.WPFScrollBar("VerticalScrollBar").SetValue(202.40963855421685)
.WPFScrollBar("VerticalScrollBar").SetValue(355.6626506024096)
.WPFScrollBar("VerticalScrollBar").SetValue(413.49397590361446)
.WPFScrollBar("VerticalScrollBar").SetValue(462.6506024096386)
.WPFScrollBar("VerticalScrollBar").SetValue(569.6385542168674)
.WPFScrollBar("VerticalScrollBar").SetValue(711.3253012048193)
.WPFScrollBar("VerticalScrollBar").SetValue(864.578313253012)
.WPFScrollBar("VerticalScrollBar").SetValue(1009.156626506024)
.WPFScrollBar("VerticalScrollBar").SetValue(1065.0)
End With
End Sub
End Module
Issue2:
_desktop.WPFScrollViewer(Locator).ScrollToPosition(Position, Orientation.Vertical) --> this works and scrolls the scrollbar and screen, reads the text of all element ,until bottom of screen
_desktop.WPFListView(Locator).ScrollToPosition(Position, Orientation.Vertical) --> this does not move the scrollbar and screen but is able to read the text of element ,until bottom of screen.
_desktop.WPFListView(Locator).ScrollToPosition(Position, Orientation.Vertical) --> this does not move the scrollbar and screen but is able to read the text of element ,until bottom of screen.
Tokci