How to run openscript from Java?

Hi!
I have recorded a web script using OpenScript. But instead of doing the playback in the OpenScript environment, I want to run the script from regular Java code.
Does anyone know how to do that?
Basically what I have tried out, is copying the code from the Java code view in Openscript, into a class in my Java project and imported all the oracle.oats... jar-files into my build path. It compiles fine.
Then I try to call;
MyOpenscriptClassInstance.initialize();
MyOpenscriptClassInstance.run();
MyOpenscriptClassInstance.finish();
The initialize fails on a NullPointer on the browser.launch(), so clearly some more setup is needed to get the script running.
I found one useful tip here How to call openscript from a flat java file about an alternative method, but I do not have oracle.oats.jagent.applications.qos among my jar-files in C:\OracleATS\openscript\plugins, so I am not able to locate the JavaAgentWrapper-class, the ScriptResult-class and the RunParameters-class.
If anyone could guide me in the right direction, I would be grateful.
I am running OpenScript version 9.2.0.0 by the way.

Hi again!
I found theoracle.oats.jagent.applications.qos jarr file now, so I feel like I am getting closer. I also set up log4j (hopefully correct using this guideline: http://snippets.dzone.com/posts/show/3248).
However, the execution fails with this error message:
*[2011-02-09 14:43:45,960]ERROR 0[Thread-2] - oracle.oats.jagent.applications.qos.JavaAgentWrapper.run(JavaAgentWrapper.java:82) - runScript.bat can't be found at null\runScript.bat*
There are errors when running the script.
My code looks like this:
package guiDriver;
import oracle.oats.jagent.applications.qos.JavaAgentWrapper;
import oracle.oats.jagent.applications.qos.RunParameters;
import oracle.oats.jagent.applications.qos.ScriptResult;
public class OpenScriptWrapper {
     private String m_jwgFile;
     private JavaAgentWrapper m_qos;
     private ScriptResult m_result;
     private RunParameters m_param;
     private static final String RESULT_FOLDER = "C:\\OracleATS\\OFT\\DatabaseChangeTest\\results";
     // the JavaAgent playback process is supposed to finish
     // within this duration specified by users.
     private static final long JAGENT_TIMEOUT = 90000L;
     public OpenScriptWrapper() {
          m_qos = new JavaAgentWrapper();
          m_jwgFile = getJWGFile();
          m_param = new RunParameters();
          m_param.setScriptJWGFile(m_jwgFile);
          m_param.setResultFolder(RESULT_FOLDER);
     private String getJWGFile() {
          return "C:\\OracleATS\\OFT\\DatabaseChangeTest\\DatabaseChangeTest.jwg";
     public void runJAWrapperWithTimeout() {
          m_result = m_qos.run(m_param, JAGENT_TIMEOUT);
          if (m_result == null) {
               System.out.println("There are errors when running the script.");
               return;
          System.out.println("Overall Result: " + m_result.getOverallResult());
          System.out.println("Overall Duration: " + m_result.getOverallDuration()
                    + "ms");
          System.out
                    .println("Result Report File: " + m_result.getCsvReportFile());
     public static void main(String[] args) {
          OpenScriptWrapper jaws = new OpenScriptWrapper();
          jaws.runJAWrapperWithTimeout();
Tips anyone?

Similar Messages

  • How to run Perl from Java

    Hi,
    I have a program written in Perl. I want to run the Perl program using Java. If there is a command which can allow me to call the perl program from Java program, please advise me.
    regards

    The most easy way is to use Runtime class to call "perl" to run your perl script.
    String sCmd = "c:\\yourPerlScriptLoc\\yourPerlScript.pl";
    Process p = Runtime.getRuntime().exec(sCmd);

  • How to run report from java code

    I am a begginner in Oracle Reports. We have no AS installed, so we run reports either from Reports Builder or by calling rwrun. I would like to know how to embed report calling into java code , let's say into simple swing application. Some example code would be welcomed. Thanks.

    Hello,
    You can find examples in :
    http://download-uk.oracle.com/docs/cd/B14099_17/bi.1012/b14048/pbr_webservice.htm
    Oracle® Application Server Reports Services Publishing Reports to the Web
    10g Release 2 (10.1.2)
    B14048-02
    14 Using the Oracle Reports Web Service
    Regards

  • How to invoke Matlab from Java

    Hi, I want to pass some data generated from Java class to Matlab, then invoke Matlab from Java to run the computation program (file written in Matlab, myfile.m). I know Matlab can use classes generated from Java, how to drive Matlab from Java?
    I appreciate your help!
    yaya

    According to their documentation, you can't. Having said that, again according to their documentation, there are plans to support this in future releases.
    m

  • How to run notepad from a web application

    hi
    can any body know,how to run notepad from a web application under tomcat

    You already asked this question:
    http://forum.java.sun.com/thread.jspa?threadID=5150005&messageID=9561597
    Obviously running notepad on the clients PC is not possible (ignoring active x)

  • How to run expdp from client ?

    Hi All,
    I tried searching google and forums for my issue but to no avail > How to run expdp from client side ....like in my laptop.
    Because currently our PROD database server has no space for expdp dump file. So I want it directed to my laptop which has an extenal USB of 1TB harddisk...via client EXPDP
    import data using impdp command
    Posted on: 08-May-2012 11:36, by user: 841731 -- Relevance: 53% -- Show all results within this thread
    below command is correct or not? if it is not correct could you please send me the correct command. impdp user/pass@databasename schemas=sourceschemaname remap_schema=sourceschemaname:destinationschemaname ...
    System generated Index names different on target database after expdp/impdp
    Posted on: 30-May-2012 11:58, by user: 895124 -- Relevance: 43% -- Show all results within this thread
    After performing expdp/impdp to move data from one database (A) to another (B), the system name generated indexes has different ...
    [ETL] TTS vs expdp/impdp vs ctas (dblink
    Posted on: 08-May-2012 21:10, by user: 869578 -- Relevance: 39% -- Show all results within this thread
    (table : 500 giga, index : 500 giga), how much faster is TTS (transportable tablespace) over expdp/impdp, and over ctas (dblink) ? As you know, the speed of etl depends on the hardware capacity. (io ...
    Oracle Client
    Posted on: 21-Jun-2012 22:47, by user: Sh**** -- Relevance: 32% -- Show all results within this thread
    Hi Guys, Please can you guys elaborate the difference between Oracle Client and Oracle Instant Client. Also, please can you advise from where I can download the Oracle normal ...
    Oracle 10g Client
    Posted on: 05-Jun-2012 10:11, by user: dzm -- Relevance: 26% -- Show all results within this thread
    to search at oracle site and this forum, but i wasn't able to find a link to download the oracle 10g client. I really need especificaly the 10g version. Anybody know the link or another way to download ...
    9i client to access 11g database
    Posted on: 22-Jun-2012 07:31, by user: kkrm333 -- Relevance: 24% -- Show all results within this thread
    Hi, Can i access a 11g database using 9i client? Thanks,
    SQLplus in Oracle Client
    Posted on: 14-Jun-2012 00:36, by user: Tim B. -- Relevance: 24% -- Show all results within this thread
    Hi, I tried to install an 11g oracle client in linux. As I've compared the files with the files when you install using the oracle instant ...
    Re: Information on Oracle Client 11202-1.1.4-6
    Posted on: 05-Jun-2012 03:33, by user: 898763 -- Relevance: 23% -- Show all results within this thread
    Actually thats the client requirement
    Analysing the performance of a single client
    Posted on: 28-Mar-2012 02:05, by user: 880172 -- Relevance: 23% -- Show all results within this thread
    timeouts even on some of the simplest queries. I want to try and get some data about how just this one client is performing and what it’s doing, but everything Google has thrown up so far is orientated around ...
    to make client connection as sys
    Posted on: 12-Jun-2012 22:04, by user: user11221081 -- Relevance: 23% -- Show all results within this thread
    Dear gurus can i connect to my server from my client machine with sysdba without giving sys password i have connected in different ways as sys@abc ...Thanks a lot.

    Though you can initiate the binary from your client side but for the file creation, there is no other way but to store it on the server side. So your best bet would be to get some space free on the server side of yours.
    Aman....

  • How to run report from form using run_object_report

    I AM USNING FORMS9I/REPORTS 9I , HOW TO RUN REPORT FROM FROM USING RUN_REPORT_OBJECT AND HOW
    TO PASS PARAMETER AS WE DID IN RUN_REPORTS PLEASE HELP ME

    here an example !
    I hope this example you can use it
    PROCEDURE pr_reporte IS
    BEGIN
    DECLARE
         repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status Varchar2(20);
    d1 DATE;
    d2 DATE;
    BEGIN
         d1 := :GLOBAL.DIA_INI;
         d2 := :GLOBAL.DIA_FIN;
         repid := find_report_object('rep_lab02');
         SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'p_fec_uno='||to_char((add_months(last_day(d1),-1) +1),'DD/MM/YYYY')||' '||
         'p_fec_dos='||to_char(d2,'DD/MM/YYYY'));
         SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'pdf');
         v_rep := RUN_REPORT_OBJECT(repid);
         rep_status := report_object_status(v_rep);
         WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED') LOOP
              rep_status := report_object_status(v_rep);
         END LOOP;
         IF rep_status = 'FINISHED' then
              WEB.SHOW_DOCUMENT('/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver','_blank');
         ELSE
              ventana('E','error reporte no encontrado','S');
         END IF;
    END;
    END;
    The 'rep_lab02' is the name of the report that you give in the node reports
    p_fec_uno and p_fec_dos they are the parameters in the report
    repserver is the name of server created with rwserver
    Greetings

  • How to run workflow from Developer studio ?

    Hi Guys,
    I searched for a work item type in the developer studio and it showed the results, but could not find out how to run it from there.. I know we can run it from there.. There is no run button or options available.
    Do i need to setup some profile options ?
    Any help in this is highly appreciated !!
    Thanks,
    Sathish

    Hi,
    Are you logged in as the Workflow Administrator or a user who has been assigned that responsibility?
    Have a look on the Administration tab and it will show you who is configured as the admin.
    HTH,
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://www.workflowfaq.com/blog ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

  • How to Run scenario from the web using HTTP web page?

    Hi guys
    Please let me know How to Run scenario from the web using HTTP web page?
    Regards
    Janakiram

    Hi Janakiram,
    ODI provides web based UI for running the scenarios using Metadata Navigator (read only of ur ODI components) and Lighweight designer (u can edit the mapping here).
    Please explore how to install metadata navigator in ODI and have a look at ODI Setup document for more information.
    Thanks,
    Guru

  • How to run import from Unix Oracle 8.0.5 database with Windows Oracle client?

    How to run import from Unix Oracle 8.0.5 database via network with Windows Oracle client? Is it possible? When I try to do it Oracle client just hangs... If not which ones are compatible Aix or Solaris to Unix or it must be a Unix client to connect to Unix Oracle database. Thank's for any help.

    Hi,
    In our project we are using this type. Since in this project server in UNIX(DEC) and client is running on windows. We have created a listener which always listen requests from client and doing the according to the request.
    Step1. create a request table, where u are inserting ur request.
    step2. create PRO*C proram, which is listening request on the table. If there is any request, call the imp (executable). This is happening on server side.
    Benifit. U can make a request from cleint and ftp the file client sit.
    Are u interested in more details and code, pls send a mail to me
    ---- Boby Jose Thekkanath
    [email protected]
    Dharma Computers(p) Ltd. Bangalore.
    null

  • How to initiate process from Java?

    Hello,
    Does anyone knows how to initiate Process from java code???
    or Which API can start a new instance of Business process??

    If you are on Oracle BPM 10g, here's a link to a thread on this forum that might also help. It is a step-by-step.
    Creating a new work item instance in a process using PAPI
    Dan

  • How to run tools from a java archive

    I used to run Multivalent from http://multivalent.sourceforge.net/ but am now getting error messages like this:
    Exception in thread "main" java.lang.NoClassDefFoundError: tools/pdf/Impose
    This happens even when I'm in the directory containing the jar file.
    I've never installed it by myself though so am not sure that I've done it right. I put the jar file into ~/library/java but that was a guess after reading lots of web pages that don't quite say what to do. They assume that I've read some intro material that I haven't been able to find.
    Any pointers on where I can find out how to do this right?
    In case it's relevant, java -version returns:
    java version "1.5.0_16"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)
    Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)
    and echo $CLASSPATH returns a blank line.

    wyvern-eater wrote:
    I used to run Multivalent from http://multivalent.sourceforge.net/ but am now getting error messages like this:
    Exception in thread "main" java.lang.NoClassDefFoundError: tools/pdf/Impose
    This happens even when I'm in the directory containing the jar file.
    I've never installed it by myself though so am not sure that I've done it right. I put the jar file into ~/library/java but that was a guess after reading lots of web pages that don't quite say what to do. They assume that I've read some intro material that I haven't been able to find.
    Any pointers on where I can find out how to do this right?
    In case it's relevant, java -version returns:
    java version "1.5.0_16"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)
    Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)
    and echo $CLASSPATH returns a blank line.
    You would do better reposting in our Unix forum here:
    http://discussions.apple.com/forum.jspa?forumID=735

  • How to run tools from a java archive (jar file)

    I used to run Multivalent from http://multivalent.sourceforge.net/ but am now getting error messages like this:
    Exception in thread "main" java.lang.NoClassDefFoundError: tools/pdf/Impose
    This happens even when I'm in the directory containing the jar file.
    I've never installed it by myself though so am not sure that I've done it right. I put the jar file into ~/library/java but that was a guess after reading lots of web pages that don't quite say what to do. They assume that I've read some intro material that I haven't been able to find.
    Any pointers on where I can find out how to do this right?
    In case it's relevant, java -version returns:
    java version "1.5.0_16"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)
    Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)
    and echo $CLASSPATH returns a blank line.

    Not necessarily. The -cp parameter can include a complete file spec. You can create a Unix alias for the whole command line. For example:
    alias compress='java -cp ~/JarFolder/Multivalent20060102.jar tool.pdf.Compress'
    I use Multivalent tools a lot for maybe a week at a time, then don't touch them for a couple of months. During the downtime I'd just forget aliases like this.
    On Macs, the default classpath includes the folder /Library/Java/Extensions. If you drop the jar file into this folder then you won't need to specify an explicit CLASSPATH variable nor the -cp option.
    I thought so too, but it doesn't appear to be the case on my computer. Both /Library/java/extensions and ~/library/java are on DefaultClasspath but CLASSPATH is empty. And even when the directories are specified, the jar file in it is ignored unless I specify that explicitly as well. I do not remember needing to do that in the past. It used to just work when it was in a classpath directory.
    I get the impression that something has changed in how Mac Java handles the classpath. In searching for answers I noticed that many people were attributing their difficulties to a classpath change in a recent update. It is not something that I see myself dealing with in the near future. But it would be helpful to know of a primer for newcomers to Java and the OS X directory conventions so they know where to put things and what paths to set for basics like this.

  • How to run JRE from an external USB disk

    Hi
    I wanted to put up a tomcat servlet engine that could run from a USB harddisk without any previous installment on the host machine. The OS of the host machine would be windows 2000.
    My first question would be; is that possible ?
    I think that when i install JRE environment on some w2k machine som registry stuff is created. And my problem here would be, how to run the java without any registry updates and directly from the USB stick that i insert into the machine.
    And my second would be; what should i install of java on the USB to make this work?
    Grateful for any input on this, or any pointers.
    Best regards
    Abid

    You would need the whole JRE on the media, and I would also assume the the full SDK/JDK as many servlet containers use the SDK's java compiler if you're doing JSPs.
    You would then simply install your servlet container and your .war files. Now I believe that registry settings are not mandatory but one must ensure the PATH, JAVA_HOME, and CLASSPATH environment variables are set accordingly, thus a startup script (.bat/.cmd) would be necessary to create the OS environment, spawn the JRE and in turn invoke the servlet container.
    I've never done this with tomcat, but I've done very similar things with Jetty FYI.

  • How to run servlet in java webserver2.0

    how to configure java webserver2.0 and how to run servlet in that

    Hi Friend,
    Try changing the servlet code to this and just tell wat happens after this.
    and wat can you see on your Browser Screen.
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class login extends HttpServlet {
    public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
    if (req.getParameter("t1") == null || req.getParameter("t2") == null)
    out.println("Enter User Name And Password");
    String uid=req.getParameter("t1");
    String pwd=req.getParameter("t2");
    res.setContentType("text/html");
    PrintWriter out=res.getWriter();
    out.println("<html>"); out.println("<head>");
    out.println("<title>Login</title>"); out.println("</head>");
    out.println("<body>");
    try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    catch(ClassNotFoundException e)
    out.println("<h3>"+e+"</h3>");
    try{
    Connection con=DriverManager.getConnection("jdbc:odbc:ms","scott","tiger");
    PreparedStatement psm=con.prepareStatement("select * from reg where uid1=? and pwd=?");
    psm.setString(1,uid);
    psm.setString(1,pwd);
    ResultSet rs=psm.executeQuery();
    if(rs.next())
    { out.println("<html><head><title>WELCOME</title></head>");
    out.println("<body><b><i>Hello user "+uid+"</b></i>");
    out.println("</body></html>"); }
    else
    res.sendRedirect("http://localhost:8080/login.html");
    } catch(SQLException e)
    { e.printStackTrace();}
    rs.close();
    con.close();
    out.close();
    After this try creating a odbc for oracle database at control panel with the name ms.
    Please inform me wat happens after this and friend do give some information about wat kind of web-server are you using.Because calling of your servlets differs the way your configure your web-server and the default configurations differ from web-server to web-server.
    Regards,
    RAHUL

Maybe you are looking for

  • Unique id For System Message

    Dear all,    Any one can please tell me the unique id for System Message.  Also i want to know the unique id for 'yes' and 'No' in System Message. Its very urgent Thanks in advance with Regards G.shankar

  • Which carrier is the best for me?

    My zip code is 42642. I am currently looking for a prepaid GSM carrier that offers unlimited talk, text, and at least 1GB of data for under $50 a month. I am having a hard time finding a specific carrier as I keep seeing different people say contradi

  • Is Replica aware stubs are in infinite loop when fail over????

              Hi           Any help on this Appreciated           See in this senario, where there is four weblogic instance runs in the cluster           and a replica aware stub(stateless bean with idempodent methods) finds a particular           metho

  • Simple question - make an image the original size

    Hello everyone. I have a very simple question. How do I make an image that I have inserted into a pages document display at the original image size. I have selected the image, brought up the inspector and selected the Graphic inspector but it does no

  • FCP 7 frequently crashed--EXC_BAD_ACCESS(SIGBUS)

    Hello! I've been editing a documentary for months. My FCP 7 crashed sometimes, however it seems especially weird today. It crashed almost every time after I just started dragging my footages. Could anyone tell me what's wrong? Thanks!!!!(I would real