Using this code snippet we can get the current cursor position in QTP. Dotnet factory is used to get the current cursor position as there is no direct way to get the current cursor position in QTP / Visual Basic
- Dim controlObject
- Dim currentX
- Dim currentY
- Set controlObject = DotNetFactory.CreateInstance("System.Windows.Forms.Control")
- currentX = controlObject.MousePosition.X
- currentY = controlObject.MousePosition.Y
You need to login to post a comment.