Geeks Talk

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.

How to automate user inputs...

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 ...

Go Back   Geeks Talk > Software Development > Java
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

Java Java related Issues and Problems

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-24-2007
Contributing Member
 
Join Date: Sep 2006
Location: bangalore, india
Posts: 1,016
Thanks: 0
Thanked 94 Times in 75 Posts
psuresh1982 will become famous soon enoughpsuresh1982 will become famous soon enough
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?
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-18-2007
Contributing Member
 
Join Date: Sep 2006
Location: bangalore, india
Posts: 1,016
Thanks: 0
Thanked 94 Times in 75 Posts
psuresh1982 will become famous soon enoughpsuresh1982 will become famous soon enough
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
Reply With Quote
Reply

  Geeks Talk > Software Development > Java

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


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


All times are GMT -4. The time now is 02:56 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2005 - 2010 GeekInterview.com. All Rights Reserved