2 Replies Latest reply: Oct 15, 2013 12:51 AM by sameer.gupta2387 RSS

    Issue with Browser.launch() for Command Prompt

    sameer.gupta2387

      Browser.launch() is able to recognize an already open browser and use the same for further testing of web application when executed from OpenScript.

      Whereas if I try to execute the same script from command prompt, oats is not able to recognize the already open browser and is only recognizing the browser after 3 or 4 times of execution.

      No browser launch exception is thrown.

       

      Command Line Used:-

      “C:\OracleATS\openScript\runScript.bat \\10.184.82.45\SharedRepository\Mysharedscript\Mysharedscript.jwg

       

      Script Code:-

      import oracle.oats.scripting.modules.basic.api.*;

      import oracle.oats.scripting.modules.browser.api.*;

      import oracle.oats.scripting.modules.functionalTest.api.*;

      import oracle.oats.scripting.modules.utilities.api.*;

      import oracle.oats.scripting.modules.utilities.api.sql.*;

      import oracle.oats.scripting.modules.utilities.api.xml.*;

      import oracle.oats.scripting.modules.utilities.api.file.*;

      import oracle.oats.scripting.modules.webdom.api.*;

       

      public class script extends IteratingVUserScript {

            @ScriptService oracle.oats.scripting.modules.utilities.api.UtilitiesService utilities;

            @ScriptService oracle.oats.scripting.modules.browser.api.BrowserService browser;

            @ScriptService oracle.oats.scripting.modules.functionalTest.api.FunctionalTestService ft;

            @ScriptService oracle.oats.scripting.modules.webdom.api.WebDomService web;

           

            public void initialize() throws Exception {

                  browser.launch();

            }

                 

            /**

             * Add code to be executed each iteration for this virtual user.

             */

            public void run() throws Exception {

       

       

                        web.window(1,"/web:window[@index='0']").navigate("http://10.184.134.187:7145/FCJNeoWeb/LoginServlet");

                        web.window(2,"/web:window[@index='0']").waitForPage(null);

                        

                        web.textBox(3,"/web:window[@index='0' or @title='Oracle FLEXCUBE UBS12.0Login']/web:document[@index='0' or @name='LoginWindow20139141174712727']/web:form[@name='frmLogin' or @index='0']/web:input_text[@id='USERID' or @name='USERID' or @index='0']")

                                    .click();

                        web.textBox(4,"/web:window[@index='0' or @title='Oracle FLEXCUBE UBS12.0Login']/web:document[@index='0' or @name='LoginWindow20139141174712727']/web:form[@name='frmLogin' or @index='0']/web:input_text[@id='USERID' or @name='USERID' or @index='0']")

                                    .setText("sameer");

                         

            }

           

            public void finish() throws Exception {

            }

      }