Results 1 to 3 of 3
  1. #1

    Is it possible to turn Batch Mode on and off from Call Script?

    Hello All,

    From my call script, I'm calling 6 different scripts, which all must be run in a specific sequence. The first 2 call scripts require the tester to input values via custom dialog boxes (which won't appear when running the scripts in batch mode of course.)

    The 3rd script in the call chain has a section of code that checks to see if a specific order number is present, if it's not, the script simulates hitting the page-down key, and looks again, when it finds the order number it stores the location in rect, then uses the win_mouse_move function to move the mouse to the order number in question and adds +x+y coords to it in order to move the mouse over the correspoding "select" link for that order. (The reason being, the developers decided to use generic select links for each order number line instead of making the order number itself clickable. See image link below)

    When this test is run in Batch mode, the following block of code works fine, but when the script is not run in Batch Mode, I get a pop-up dialog from WinRunner becuase of this line of code...:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">
    rc = win_mouse_move (&quot;dispatch&quot;, rect[0]+730,rect[1]+5);</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">...telling me that the location for the order number is 'out of range'."

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">
    web_link_click(&quot;»Manage Orders&quot;

    web_find_text(&quot;dispatch&quot;,ddt_val(table2, &quot;ordernumber&quot,rect,&quot;&quot;,&quot;&quot;,1,TRUE);
    rc = win_mouse_move (&quot;dispatch&quot;, rect[0]+730,rect[1]+5);
    if (rc!= E_OK){
    type (&quot;&lt;t2&gt;&lt;kPgDn_E&gt;&quot;
    web_find_text(&quot;dispatch&quot;,ddt_val(table2, &quot;ordernumber&quot,rect,&quot;&quot;,&quot;&quot;,1,TRUE);
    win_mouse_move (&quot;dispatch&quot;, rect[0]+730,rect[1]+5);

    . </pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Wakefire/Eric/QA/Images

    I know there has to be more than one way to skin this cat. Is there any way to check and see if the order number location is out of range without causing the out of range error dialog box to pop up?

    Or is there a way to turn batch mode on and off for specific scripts in my call chain?

    Or is there a better way for determing if the order number is further down the page and scrolling to it without using the page-down/ min_move_mouse functions?

    Originally I tried a do/while loop, waiting for the value of rc to become E_OK, but for some reason, even when the order was visible without using the page-down function, it would step through the loop anyway.



  2. #2

    Re: Is it possible to turn Batch Mode on and off from Call Script?

    Almost forgot:

    WinRunner Version 7.50 Build 7263
    Using the WebTest Add-in
    OS = XP sp1
    IE Ver: 6.0 SP2

  3. #3
    SQA Knight
    Join Date
    Jun 2002
    Cupertino, CA, USA

    Re: Is it possible to turn Batch Mode on and off from Call Script?


    You can't turn batch mode on and off. You can verify if the corrdinates are out of range by getting the width and height of the window:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">win_get_info(&quot;dispatch&quot;,&quo t;width&quot;,width);
    win_get_info(&quot;dispatch&quot;,&quot;height&quo t;,height);
    if((rect[0]+730 &gt; width) &#0124;&#0124; (rect[1]+5 &gt; height))
    pause(&quot;Corrdinates out of range&quot</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">This is not the best way of solving this problem, however. What you need to do is search for the order number in the HTML table in which it occurrs, then use web_obj_get_child_item to get the physical description of the corresponding web link. From your bitmap, it looks like the order numbers are in column 1, while the links are in column 10. Your code should look similar to the following:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">set_window(&quot;dispatch&quot;,10);
    tbl_get_rows_count(&quot;YourTable&quot;,rows_coun t);
    order_number = ddt_val(table2, &quot;ordernumber&quot;
    for(row = 1; row &lt;= rows_count; row++)
    tbl_get_cell_data(&quot;YourTable&quot;,row,1,cell _data);
    if(order_number == cell_data)
    web_obj_get_child_item(&quot;YourTable&quot;, row, 10, &quot;html_text_link&quot;, 0, link_physical);
    if(row == (rows_count + 1))
    tl_step(&quot;Find Order&quot;,FAIL,&quot;Order Number: &quot; &amp; order_number &amp; &quot; could not be found&quot;</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 07:48 PM.

Copyright BetaSoft Inc.