Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on How to automate user inputs... within the Java forums, part of the Software Development category; We have a Java program which prompts user for 4 or 5 inputs one after the other and then does its computation. The inputs are mostly file names and folder ...
|
|||||||
|
|||
|
How to automate user inputs...
We have a Java program which prompts user for 4 or 5 inputs one after the other and then does its computation. The inputs are mostly file names and folder paths. I am trying to figure out a way of automating these inputs. We don't want to (and can not) change the program to read inputs from a file. We only have class files for the program with us.
Is there any way i can automate these user inputs. Say for instance, the inputs would be specified in a text file beforehand and would be read by the java program on each prompt. May be it will require some batch or shell scripting. I am not sure though. Can someone give some inputs? |
| Sponsored Links |
|
|||
|
Re: How to automate user inputs...
For most programs we can make the input come from a file at the command line:
java MyClass <filename.ext The left arrow tells the OS to feed whatever source follows into stdin of the program. See if that does the trick! The program should read the file one line at a time just as if the user was typing one response at a time. The newline in the file acts just like the enter key for the user. Make your own simple program that just reads lines from stdin and see how it behaves with different files. -------------------- suresh |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can we automate flex | Geek_Guest | Rational Robot | 2 | 11-18-2008 03:46 PM |
| How can I pass inputs to job through JCL | Geek_Guest | MainFrame | 3 | 02-26-2008 05:37 AM |
| Can we use QTP to automate the SmallTalk application | Geek_Guest | QTP | 0 | 07-22-2007 07:41 AM |
| Regarding Inputs | Namedm | C# | 2 | 06-11-2007 03:57 AM |
| Workflow to automate a web page | Shisatya | QTP | 0 | 05-05-2007 06:53 AM |