• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to identify the controls of a online html page

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to identifying the controls of a online page (say, yahoo or rediff) through java written code. I am trying to populate the data which is stored in a file to a online page. (Example my user id and password are stored in a file instead of populating the xxxxxx (yahoo/rediff or whatever ) user id & password manually I am trying to populate through my appplication but for that I suppose I need to idenify the controls of the html page then I can populate the controls). Can anyone advise me for how to go about to achieve this.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By "controls" I presume you mean form elements? If so you need to look at Regular Expressions (java.util.regex). You can read the HTML and find the input elements you want. Of course this requires you know the names of the form elements you are after. And to actually manipulate the form elements in a browser using a Java application - I don't know how you could do that without calls to native code. You could make a request to the server with the appropriate parameters/attributes, but the response would be coming to your Java app, not the browser.
 
Khais Khan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for ur interest and ur reply. I am just trying to populate the online page fields which we usually do manually and I am not gonna do anything with the server. My intension is just to automate the gui testing using my own application. I suppose u can nderstand what I am trying to.
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I am not gonna do anything with the server


So you are just testing clientside code? If so I'd look at some other solution than Java (you can manipulate the contents of an IE instance with VB for example).

If not and you are just interested in testing a web app - have a look at JMeter or Microsoft WAS. Both free, both workable (if not quite perfect) solutions.
 
Khais Khan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah, as u said I am just looking at client side. I am trying to replace the web gui testing tools.
 
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
check out JWebUnit its open-source unit testing framework for webapps. Basically it gives you the ability to spider your own website, filling in forms however you like and submitting them.



Basically, it just encapsulates the behavior of another well known web testing framework called HttpUnit
 
Khais Khan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your advice.
 
reply
    Bookmark Topic Watch Topic
  • New Topic