Execute rft test script using agent controller? - java

I need to execute a test script that generated by Rational Functional Tester using Rational Agent Controller.
How can I do that? And if that's not possible what should I do to execute the script on a computer that hasn't RFT installed on?

Post RFT 8.2.0.1 , to be able to execute a script on a remote machine RFT must be installed on that machine.
*****EDIT***
RFT's installation is a complete package installation ,meaning when you install RFT it installs a complete product that is capable of recording /playback scripts on all the supported domains.
So it's not possible to say that on this machine X install only the recorder and on the machine Y install only the playback engine.
Another approach perhaps could be to have some kind of tool on the server machine that would say that here is the script , go and execute on the machine Z , that does not have RFT installed .. but as the script may have controls recorded for all the domains (html/java/.net/SAP/Win32) all the supporting files DLLs /JARs (consiting of proxies and OS related shared libraries) would have to be transferred to that machine and that I think would be quite a task to do :) . So in my opinion it's not impossible but it's just not been done yet.

Wrong, it is not impossible. Just takes a lot of configuration.
http://www-01.ibm.com/support/docview.wss?uid=swg21319598
To execute RFT scripts on a remote machine:
Make sure the scripts (java or .net ) are compiled before deploy for remote execution.
After they are compiled successfully, In order to start remote execution, on the master machine, the Test Manager needs to be installed and configured correctly.
The following is the configuration on the TM on the master machine: In the "Execution" tab, right click on "Computers", and add new computer,specify the computer name, property, and the port information, so TM will be able to locate the remote machine.
The set up for the remote machine will be described separately for java script and .net script. For java script, the following is needed on the remote machine:
Test Manager Test Agent. (can be installed from Test manager CD).
Rational Functional Tester Test Agent.( can be installed from RFT installation package).
For .net script, the following is needed on the remote machine:
Test Manager Test Agent. (can be installed from Test manager CD).
Rational Functional Tester Test Agent.( can be installed from RFT installation package).
.Net framework.(Visual Studio is not needed on the remote machine, there is currently defect on this, reference to a separate tech note on the workaround for this, searching "remote execution with .net script").
Last, but not the least, If the customer's AUT is Windows/.net/SAP based, then .net framework needs to be installed on the remote machine regardless whether it is java scripting or .net scripting. This is because some part of RFT's code gets placed into the application during infestation, the RFT code for these applications are written in C#, so at run time, the .net framework is needed to playback successfully.

Related

Esxi remote machine automation

My requirement is to automate an esxi remote machine using java.
So, I am able to automate vmware workstation and fusion by creating a bat file where I have added all the vmrun commands and executing the bat file using java.
Can anyone help me in achieving the same for esxi remote machine where I am using commands (like vmrun) for opening a browser in remote machine and passing the url.
I think vmrun utility is no longer supports for esxi.
powercli module of powershell solved my problem

Running a Web Service without opening Eclipse or any IDE

I want to develop a Java based Webservice on my laptop. This webservice will take one input parameter, query my SQL Server database and will fetch information and will return it back.
I know, I do not need a webservice here. But, right now, I am just testing my android application which will call this webservice and will show return data on my device.
So, I have developed a java program which connects my SQL Server Database (which is present on my laptop) and returns a value against the parameter passed. I have made it a webservice by creating endpoints and publishing it from another class.
For reference, something like answer on this thread
So, when I run it from my Eclipse, I can go to a browser and run my webservice, pass parameter and get result.
But, once I close my eclipse, its no more accessible. I am new to this and after studying I am guessing that I will need IIS to host it on my laptop.
I want to ask, whether it is possible to run/publish it locally on my laptop as a background process so that I can test my android app by calling the same?
Future scope -
I am going to deploy this webservice in my company which will connect my database. Both webservice and sql server will be on same machine. I am going to call this webservice remotely over internet from my android device to show the results.
I guess, I will need IIS in future right? Is there any other way to fulfill this requirement? Please provide some ideas.
If, within Eclipse, you can get your web application deployed so that it is accessible via a browser, then you definately can do it without eclipse.
Eclipse uses plugins like Tomcat or Glassfish to run your webserver. These programs are available outside of Eclipse as standalone services. You can install these and run them as background processes at the command line.
Just figure out which one you are using in eclipse (or which one you want to use) and look for a standalone copy on the web.
Here's Tomcat, btw.
I am done with this.
What I did is, I went to Eclipse, selected my Project-> Right Click -> Export -> Under General -> Ant Buildfiles
This created, Build.xml in my Project directory.
I deleted all the class files and recompiled them using ant command.
In my case, target name was build-project which compiles all the java files.
So, I did ant build-project
Note - This was done as Eclipse was using different JDK version.
Now, I called my publish class to publish my webservice with
ant publish
This was half done as this was running in interactive mode.
Then I created a bat file with following command -
"path_for_ant_bin_directory\ant" -buildfile "path_to_build_file\build.xml" publish
This was opening up the command box. So, I created a vb script to run the bat file in background
Set oShell = CreateObject ("Wscript.Shell")
Dim strArgs
strArgs = "cmd /c path_to_bat_file\my_bat.bat"
oShell.Run strArgs, 0, false
And, now it nicely runs in background and I can access my webservice.
Hope it helps someone with similar requirement.

jenkins job not triggering commands and performing ui validations in the targeted machine

I configured a job for doing GUIAutomation(which got developed using java code including running commands and keyboard events) in the targeted machine.
Extra Info:-
I am running a command to launch the installer(installer GUI should come).....but its not happening
When I got any error I am capturing a image using JAVA DefaultToolkit API, but very time its coming as Black, nothing there to watch.
GUIAutomation tool was developed by myself.
Please help me to overcome this problem, since I have to automate it through jenkins.
Usually, problems running GUI programs in Jenkins occur because of the Jenkins service not having privileges to access the display of the slave (or master, you don't mention which) that is running the job. A typical solution is to start the slave via JNLP, which requires logging on to the slave, navigating to the slave's page on the jenkins master (via browser on the slave) and launching the slave process via the button on that page. You can also launch using the javaws command which will be shown on the same page.
On Windows slaves running as a service, you may have success by configuring the service to run as a user with login and desktop privileges for the slave - the default is the Local System user which has no such rights.
I have done the same job as you.
You have to create the jnlp connection. I create one batch file in slave machine such as: jar -jar slave.jar -jnlpurl (your url)/slave-agent.jnlp
If it's remote slave, it's better to use VNC instead of remote desktop when you operate that machine. Because when you close the session, remote desktop will hold the session, so the screenshot would be black.

How to open a file and view on remote windows machine

I want to open a file on remote windows machine from my local windows machine. The file should be visible on remote machine only.
My problem is, I should open a bat file on remote pc which creates access to do something like opening browser etc.
I did using PSExec to run the bat file remotely. Everything looked good, but when i try to open the browser on remote pc, it does not open browser but shows browser processes in task manager.
When I go and open that bat file manually on remote machine everything works fine. Browser opens and my work is done.
But I want to do that from my local machine especially from the command line. So that I can use this commands in Java.
Please help. If question is not clear please ask for more info.
Try using the -i option with psexec or specifying a session ie. -i 1
From the psexec manual.
'-i Run the program so that it interacts with the desktop of the specified session on the remote system. If no session is specified the process runs in the console session.'
example:
C:\SysinternalsSuite\psexec.exe \remotecomputer -u DOMAIN\administrator -p adminpass -i 1 "\remotecomputer\c$\Program Files (x86)\Google\Chrome\Application\chrome.exe" http://tinyurl.com/6fbgntx
I'd suggest you to use WMI - It management instrumentation. It allows running process on remote machine (obviously if you have enough permissions).
You can either access WMI from Java using one of popular interoparability libraries (JaWin, JInterop, JIntegra) or write JScript or VBScript and execute it from java.
JaWin and Jinterop are open-source. JIntegra is not.
JaWin requires windows OS on client machine. JIntegra and JInterop can be executed from other OS.
I used all 2 suggested methods and all 3 libraries. Probably now I prefer JInterop.

Remote SVN administration

I'm writing a Java app that performs various SVN actions (commit, copy, etc) from a remote machine. I access SVN from my Java app using the SVNKit API.
I also need to perform some administration actions, such as creating users and repositories. These actions are not available via the SVNKit API, or even the SVN command-line interface. Normally these would be performed directly on the SVN server, using svnadmin or a GUI equivalent.
(It is possible with SVNKit to create a local repository, but I need to create a repository on a remote machine)
So it seems my options are:
Programatically connect from java
app to svn server using SSH or
similar, then use Runtime.exec()
to run svnadmin
Deploy a web application (like this one) on machine running svn server, then connect to it from java app using HTTP
Map a drive from java app machine to svn server machine (both are windows machines), then run svnadmin from the former, supplying the path to the latter as an argument
Is there any other way to perform these admin tasks from a remote machine?
Since svnadmin does not itself work remotely (as stated explicitly in its documentation), your problem is no different from running any other local application from a remote computer.
BTW, your option 3 is not advisable:
Do not create a Berkeley DB repository
on a network share—it cannot exist on
a remote filesystem such as NFS, AFS,
or Windows SMB. Berkeley DB requires
that the underlying filesystem
implement strict POSIX locking
semantics, and more importantly, the
ability to map files directly into
process memory. Almost no network
filesystems provide these features. If
you attempt to use Berkeley DB on a
network share, the results are
unpredictable—you may see mysterious
errors right away, or it may be months
before you discover that your
repository database is subtly
corrupted.

Categories