• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

get focus to the textbox

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
After I opened a website using a browser called from my Java program, I want to send text to an input textbox in this website using Java and Robot class without using Selenium WebDriver. So how to get focus to that textbox? I know how to use 'Robot class' to send values to the field.
 
Rancher
Posts: 4739
38
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I know how to use 'Robot class'  


One way to get focus on a textbox is to click on it.  The Robot class can send a  click  to anywhere on the screen.  It just needs an x,y position inside the textbox.
Another way might be to click on the page and send a tab.
 
mar abed
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks , would you please explain or give example about : send a tab.

Norm Radder wrote:

I know how to use 'Robot class'  


One way to get focus on a textbox is to click on it.  The Robot class can send a  click  to anywhere on the screen.  It just needs an x,y position inside the textbox.
Another way might be to click on the page and send a tab.

 
Norm Radder
Rancher
Posts: 4739
38
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think this sends a tab:
 
I guess I've been abducted by space aliens. So unprofessional. They tried to probe me with this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic