Get Cursor Position in QTP


/ Published in: Visual Basic
Save to your folder(s)

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


Copy this code and paste it in your HTML
  1. Dim controlObject
  2. Dim currentX
  3. Dim currentY
  4.  
  5. Set controlObject = DotNetFactory.CreateInstance("System.Windows.Forms.Control")
  6. currentX = controlObject.MousePosition.X
  7. currentY = controlObject.MousePosition.Y

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.