1834199 Members
2609 Online
110065 Solutions
New Discussion

Input Stream for XVFB

 
Tom Jackson
Valued Contributor

Input Stream for XVFB

Hi:

I would like to run an X window application from a command line and thought xvfb would do the job. I want to use a file as standard input and pass motif window commands such as F10 and motif windows pull down shortcuts to initiate a database rebuild.

Does anyone know how to send an F10 from a standard input file?

Tom
7 REPLIES 7
A. Clay Stephenson
Acclaimed Contributor

Re: Input Stream for XVFB

The main thing that you need to understand is that inder UNIX there is no one character (or sequence of characters) generated by F10 (or F2, Left-Arrow, F3. ...). The character sequences are a function of the TERM setting and its associated terminfo entry.

Here is one method:

With your desired TERM environment variable set and exported (e.g. export TERM=dtterm), issue an "untic" command and look for the kf10 entry. This indicates the sequence of characters an application expect to see when the user presses F10.
e.g. kf10=\E[21~ (for dtterm). This indicates that the application is looking for an ESC followed by [21~.

To generate that sequence from the shell:
echo "\033[21~\c"
Note the "\c". That instructs the echo command not to append the default LF to the output stream. \033 (octal 33, decimal 27) is the ASCII ESCAPE character.

If it ain't broke, I can fix that.
Kenneth Platz
Esteemed Contributor

Re: Input Stream for XVFB

Tom,

If you are wanting to pass actual keystrokes and button clicks to your windows, it isn't quite as simple as redirecting standard input to your window. X Windows operates off of "events", not necessarily keystrokes. For example, when you press a key, it generates a KeyPress event, and when you release it, it generates a corresponding KeyRelease event. Likewise, when you press a button, it generates a ButtonPressed and ButtonReleased.

Now there *are* tools available which can capture and replay your X Window events, and I believe the Response Center has them available (but unsupported).
I think, therefore I am... I think!
Tom Jackson
Valued Contributor

Re: Input Stream for XVFB

Clay/Ken:

Thanks for the responses. Clay, I have the same definition for the F10 key, \E[21~. Unfortunately, Ken is correct, the application does not recognize it. I tried echo with a pipe and input redirection from a file.

Ken mentioned the "Response Center" has some tools available to do this. Where is the response center, and can you give me more information on available tools?

Tom
Kenneth Platz
Esteemed Contributor

Re: Input Stream for XVFB

Tom,

You can call the Response Center @ (800) 633-3600 in the US, or you can place a call using the "support call manager" on the ITRC.
I think, therefore I am... I think!
Mike Stroyan
Honored Contributor

Re: Input Stream for XVFB

Running a GUI application from an automated script is a tricky business. It would be much easier to use some task automation process that was designed into the application.

If you really need to get an X window application to replay operations, you could look into testing tools such as XRunner.
http://www.mercuryinteractive.com/products/xrunner/
It is intended to take a product through a recorded test script to perform reression testing.
Tom Jackson
Valued Contributor

Re: Input Stream for XVFB

Ken:

Thanks for the second reply. Unfortunately, I don't have an active support agreement. I'll need to mooch one from someone else in my organization.

Mike:

Thanks for the warning. This is just one possible solution for our problem. I went to the Catalog of HP-UX Software and found xse binaries for 10.20. Do you think this will run on 11.0? We may use xse with xvfb to solve our problem.

My real problem is that we have a project/data management system (APM) that we need to update automatically. We currently have to use a GUI to rebuild the mSQL database after certain changes.

We may be able to modify the database directly. This may be an easier solution if I can get the vendor (LMS) to provide some insight.

Tom
Mike Stroyan
Honored Contributor

Re: Input Stream for XVFB

The 10.20 version of xse should run fine on 11.x. It could be difficult to find the right windows, events, and timing to get the application to react as you want.

It may be a little easier running the application under xvfb without a window manager. That will reduce the complexity.
Do watch out for sending events too quickly. They may not cause the same reactions if the system is more heavily loaded and the application is running a little slower.