• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need to automate logging in website  RSS feed

 
Mahesh Bhatt
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am new to this and need help here. Sorry if it sounds like asking homework to be done, but this is not the case.

We have a website where we perform the following steps daily, I am looking for a way to automate this.

1) open the url like www.abcd.com
2) login using my employee id and password (I guess I will need to read it from a file while automating).
3) a page opens and we need to enter a numeric value in a table.

Any help will be highly appreciated.

Regards
Prashant
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are at many possibilities. Two Java-centric ones: if the web site doesn't use redirects and the forms are fairly simple, you could juse use HttpURLConnection and code things up in Java directly. If the site's behavior is more complex, then a Web testing tool like HttpUnit is your best bet, because it provides routines to do the things that are complicated to do yourself.
 
ak pillai
author
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Although the java.net package provides basic functionality for accessing resources via HTTP, it doesn't provide the full flexibility or functionality needed by many applications. The Jakarta Commons HttpClient component seeks to fill this void by providing an efficient, up-to-date, and feature-rich package implementing the client side of the most recent HTTP standards and recommendations.

http://jakarta.apache.org/commons/httpclient/

If it a simple request use HttpURLConnection class:


sample code:

 
Mahesh Bhatt
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys,

That helps.

Regards
Prashant
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!