Showing posts with label STAF. Show all posts
Showing posts with label STAF. Show all posts

Saturday, June 29, 2013

Fixing staf: error while loading shared libraries: libSTAF.so: cannot open shared object file: No such file or directory

 Assuming you have installed STAF in Lubuntu (13.04 in my case), running staf local ping ping you may observe the following error:

staf: error while loading shared libraries: libSTAF.so: cannot open shared object file: No such file or directory

To fix this, modify/add LD_LIBRARY_PATH to ~/.bashrc like:

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/staf/lib"

Starting STAF for given user on logon in Lubuntu

One way of starting STAF in Lubuntu for a given user is to edit ~/.profile, thus say add the following line towards the end of the file.

/usr/local/staf/startSTAFProc.sh

Monday, November 10, 2008

InstallShield crashing when run from a remote machine using STAF

I have been using STAF/STAX for a while now as a framework on top of software test automation. When we started moving some of our tests in Windows Vista noticed that there have been cases where uninstallation of the software under test is crashing. I thought it was some component not playing well with Windows Vista but I when I tried to perform the uninstallation sequence manually everything was fine and dandy. So I started digging around and I found out that in Windows Vista, the following command may fail.

C:\>staf remotemachine process start command "C:\PROGRA~1\COMMON~1\INSTAL~1\Driver\1150\INTEL3~1\IDriver.exe /M^{1CD6500F-DE1E-44AC-A279-4C85247A9A85^}"

Poking around even more and I finally found a workaround, to get the above command working in Vista, do:

C:\>staf remotemachine process start shell command "C:\PROGRA~1\COMMON~1\INSTAL~1\Driver\1150\INTEL3~1\IDriver.exe /M^{1CD6500F-DE1E-44AC-A279-4C85247A9A85^}"
Notice the use of shell to make this command to work. I would have loved to know why this is causing problem in Windows Vista and not in XP/W2k3.

~ts

Sunday, December 09, 2007

STAF silent install with options on user login and quick menu

STAF is a software test automation framework, see this link for more information. When installing the software remotely without manual intervention, silent install is must have feature. The package was actually created using InstallShield Multiplatform. In fact silent installation is documented in the STAF User's Guide. But unfortunately it does not mention all the options, just the most frequently used ones. What I am going to do here is to document how to get those options and a sample command to install STAF with "Start STAF on user login" and "Place Icons on the Quick Start Menu" not included during installation. To get the command line options, you need to read the InstallShield .uip file that defines all those options. For STAF this can be found from this link. To get the command line option for "Start STAF on user login" and "Place Icons on the Quick Start Menu" was not really that challenging because the developers were using variables that pretty much describes them. Example, stafOptions.startSTAFOnLogin was used for "Start STAF on user login" and stafOptions.iconsOnQuickStartMenu was used for "Place Icons on the Quick Start Menu." With the information at hand, command should now look like below:
d:\>STAF323-setup-win32 -is:log D:\ismplog.txt -silent -W license.selection="Accept" -W setupTypes.selectedSetupTypeId="Full" -W stafOptions.updateEnvironmentVariables="System" -W stafOptions.defaultIPvVersion="IPv4 only" -W stafOptions.startSTAFOnLogin="false" -W stafOptions.iconsOnQuickStartMenu="false"
This assumes that STAF323-setup-win32.exe is in the system path or on D:\. ~ts

Sunday, November 11, 2007

Configure STAF to run as a Windows service

There are some advantages on running STAF as a Windows service. Common reason being that the STAF functionality is available even without user logged into the system.

Configuring STAF to run as a service needs an auxiliary application, like srvany.exe. This file is part of Windows Resource Kit. Due to licensing restrictions I cannot attach the file here but it should not be big of a problem as you can download the resource kit from Microsoft for free. Do a google using the keywords "Windows Resource kit" and start from there. The filename of the installer normally is rktools.exe. Once downloaded, install the software look for srvany.exe and instsrv.exe.  You can copy this files somewhere so that you can use it other machines. See below for the steps for configuring STAF to run as a service:

1) Copy instsrv.exe and srvany.exe into C:\Windows\System32 (actually $windir\system32 ).

2) In Windows console ( Start->Run "cmd.exe"), change to directory C:\Windows\System32.

3) Install a Windows service placeholder, like:

instsrv.exe STAF C:\Windows\System32\svrany.exe

Note "STAF" here can be any string but for convenience and easy correlation we used STAF.

4) Modify this service to actually run STAFProc.exe via registry. Open HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\STAF

5) Under this subkey, add a key named as "parameters".

6) Select the new "parameters" key and add a string value named "application". It should be of type REG_SZ.

7) Change the data to "C:\STAF\bin\STAFProc.exe".

8) Close regedit.exe.

9) If we need STAF to interact with the desktop then minor adjustment is necessary. Modify the STAF service using services applet ( in Windows 2003/Windows XP it can be accessed via Start->Control Panel->Administrative Tools->Services ). Double click on STAF service ( or via context menu then Properties ), select Log on tab. Enable "Allow service to interact with desktop"

Useful links:

How To Create a User-Defined Service by Microsoft

~ts

CPP Quick Guide

Basics Hello world User input While loop If statement For loop Switch statement Read file using ifstream Write to a file using ofstr...