Win a copy of Getting started with Java on the Raspberry Pi this week in the Raspberry Pi forum!
  • 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • 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?
 
Marshal
Posts: 27900
94
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.
 
yeah, but ... what would PIE do? Especially concerning this tiny ad:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
reply
    Bookmark Topic Watch Topic
  • New Topic