get_frame_number

get_frame_number(); - get the number of the frame that contains the element (available from version 7.0.15)

After testing, the function returns the result of its work to the script :
  • frame number – the number of the frame in which the element
  • -1 – if it is not contained in the frame

    PHP example:

    <?php $xhe_host = "127.0.0.1:7014";
     
    //connect the object to control the emulator, if not already connected
    if(!isset($path))
       $path = "../../../Templates/xweb_human_emulator.php";
    require($path);
     
    //Start
    echo "<hr> <font color = blue> interface->".basename(__FILE__)."</font> <hr>";
     
    //1
    echo "1.Let's go to the polygon:";
    echo $browser->navigate("http://humanemulator.net/poligon/form.html")."<br>";
     
    //2
    echo "2.Get the frame number from input element 2:";
    echo $input->get_by_number(2,0)->get_frame_number()."<br>";
     
    //3
    echo "3.Get the frame number of a nonexistent element:";
    echo $button->get_by_number(2,100500)->get_frame_number()."<br>";
     
    //end
    echo "<hr> <br>";
     
    //Quit
    $app->quit();
    ?>

    Python example:

    # Additional paths
    import sys
    sys.path.insert(0, '../../../Templates PY/')
     
    xhe_host = "127.0.0.1:7012"
    from xweb_human_emulator import *
     
    # Start
    echo("<hr> <font color = blue> interface.xxxxxxxxx </font> <hr>")
     
    # 1
    echo("1.Let's go to the polygon:")
    echo(browser.navigate("http://www.humanemulator.net/poligon/form.html"), "
    ")
     
    # 2
    echo("2.Get the frame number of input element 2:")
    echo(input.get_by_number(2,0) .get_frame_number(), "
    ")
     
    # 3
    echo("3.Get the frame number for an element in a nonexistent frame:")
    echo(input.get_by_number(2,10) .get_frame_number(), "
    ")
     
    # end
    echo("<hr> <br>")
     
    # Quit
    app.quit()

    C# example:

    #region using
     
    using System;
    using System.Diagnostics;
    using System.Collections.Generic;
    using System.Linq;
    using System.IO;
    using System.Text;
    using System.Threading;
     
    using XHE;
    using XHE.XHE_DOM;
    using XHE.XHE_System;
    using XHE.XHE_Window;
    using XHE.XHE_Web;
     
    #endregion
     
     class Program: XHEScript
     {
    static void Main(string [] args)
    {
    //init XHE
    server = "127.0.0.1:7012";
    InitXHE();
     
    //Start
    echo("<hr> <font color = blue> interface.get_form_number </font> <hr>");
     
    //1 step
    echo("1.Let's go to the polygon:");
    echo(browser.navigate("www.humanemulator.net/poligon/form.html") + "<br>");
     
    //step 2
    echo("2.Get the form number from input element 2:");
    echo(input.get_by_number(2, "0").get_frame_number() + "<br>");
     
    //step 3
    echo("3.Get the form number of the input element with dream 5:");
    echo(input.get_by_number(5, "10").get_frame_number() + "<br>");
     
    //end
    echo("<hr> <br>");
     
    app.quit();
    }
    }

    Java Script example:

    //connect the object to control the emulator, if not already connected
    xhe_host = "127.0.0.1:7012";
    echo = require("../../../Templates JS/xweb_human_emulator.js");
     
    //Start
    echo("<hr> <font color = blue> interface.get_number </font> <hr>");
     
    //1 step
    echo("1.Let's go to the polygon:");
    echo(browser.navigate("http://www.humanemulator.net/poligon/input.html") + " r  n");
     
    //step 2
    echo("2.Get the frame number from input element 2:");
    echo(input.get_by_number(2,0) .get_frame_number() + " r  n");
     
    //step 3
    echo("3.Get the frame number in a nonexistent frame:");
    echo(input.get_by_number(2,10) .get_frame_number() + " r  n");
     
    //end
    echo("<hr> <br>");
     
    //Quit
    app.quit();