• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Java code for Logging into a weburl and choosing various options in Menu bar

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everyone,

Here is my requirement: I need to login to a Web URL and navigate to the menu bar and further click on various options.

I found some codes for login. But I am not sure if navigating to menu bar is feasible in java.

Would you be able to help me in this regard, as it bit urgent?

Regards,
Kavitha
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kavitha shan wrote:Hi Everyone,

Here is my requirement: I need to login to a Web URL and navigate to the menu bar and further click on various options.

I found some codes for login. But I am not sure if navigating to menu bar is feasible in java.



What menu bar? What options?
 
Sheriff
Posts: 26770
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It helps if you stop thinking about what you see in the browser, like menu bars and so on. What you actually want to do is to send the same HTTP requests to the web application that a browser would send. Also you have to handle the responses you get from the web application in the same way that a browser would.

So that means you have to find out what requests your browser is sending, for a start. If you're using Firefox then the HttpFox plugin will help you with that, and I expect other browsers have similar tools. Then you have to write Java code which sends those requests. If you're logging in then most likely the web application will send you a cookie, which you'll have to send back with subsequent requests to maintain the session. I have seen other people suggest that HtmlUnit is a useful tool for managing this process, but I haven't used it myself.
reply
    Bookmark Topic Watch Topic
  • New Topic