This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

UI testing  RSS feed

 
D Preethi
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am trying to write a test class for my UI screens of an application and am hitting with one issue. At one point of time, the application shows multiple windows, and I need to get handle of one of those windows (with a title I know) and click on the OK button in that window.

Is there any way I can get handle to that particular window?


Thanks in advance,
Preethi
 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With JNI and the Windows' native call EnumWindows you can, but it's not a pleasant road to take. There's a reason I rewrote the application I used that call in into C#.

If you know the window's location and you can use the Robot class to press on its title bar to activate it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!