Hello everyone. I started learning
Java (and programming in general) only recently and thus I don't know how to do much so please do go easy on me
. Right, I'll try to explain what I'm trying to do:
I'm working with a browser-based CRUD application (well it's a little bit more advanced than that but yeah..). In general I want to make an application that can connect either to the crud app or through it (using the functionality) to connect to the server. The Long-term goal being to add a layer of abstraction allowing us to do lots of neat stuff (such as get more complicated statistics, use pre-set templates to avoid common errors and simplify work and so on..). It's a wonderful idea, but since I'm pretty much clueless about how to pull it off at this point it's going to take some time (which is OK since the goal is to learn and if I should incidentally simplify my work in the process that would be a nice perk). However I'm pretty much stuck on how it is you actually connect to and manipulate a web-based application(or a website for that matter)...
My main issue is how to connect and
exchange information with the application? More specifically for my smaller projects I need to be able to do the following:
1.) Manipulate the elements on an already active screen...which is just a fancy way of me saying I want to feed the program a list of abbreviations (such as RU, BG and so on), have it check for a match in the open browser window and if one is found to check the relevant check box on the active screen.
- the simplest way of realizing it I came up with is to simulate keystrokes on the keyboard, since this can be done manually with the following sequence: *copy abbreviation* -> press ctrl+f on the active screen and paste it in-> search for it-> press esc-> press tab-> press space. Since this process needs to be repeated more than 30 times it's quite cumbersome to do it by hand. The problem here is I have no idea how to do that and where to look for a solution so any hints are welcome
- the other way is to manipulate the check boxes by somehow referencing them except I don't know how and if I can refer to objects on an active webpage. Again any hints as to how to do that or books, or general direction I should be looking in would be greatly appreciated.
2.)Programatically navigate to,refresh and draw data from a screen without making it visible(but it can be open in the background). The screen being a table with data which, for some weird reason, has a set limit of maximum items it can display. The issue being I need more than the maximum limit for a statistic so I want to refresh and get the information over a set period of time and have my application reprocess it and generate a report I can use. How I'm currently accomplishing that is by periodically copying the information manually and pasting it into an Excel VBA sub I wrote which processes it further and prints out a report.
I basically want to make the manual part of that automatic. Once again, any suggestions are appreciated
The main questions are:
*) How does the interaction between a Java desktop application and a web application work in general?
*) How to log in using Java?
*) How to navigate the app programatically?
*) How to refer to and manipulate the elements?
*) How to emulate keystrokes with Java?
*) How to request and receive information from the web application?
Additional information that might be useful: The browser is limited to Internet Explorer. The language the application is written in is JavaScript.
Thank you for taking the time to read through my topic and any guidance you provide.
Happy coding ~