This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
en:objects:interface:get:get_alt [2020/10/13 15:21] 127.0.0.1 external edit |
en:objects:interface:get:get_alt [2026/08/05 22:44] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | < | ||
| + | PHP example: <code php><? | ||
| + | |||
| + | //connect the object to control the emulator, if not already connected | ||
| + | if(!isset($path)) | ||
| + | $path = " | ||
| + | require($path); | ||
| + | |||
| + | //Start | ||
| + | echo "< | ||
| + | |||
| + | //1 | ||
| + | echo " | ||
| + | echo $browser-> | ||
| + | |||
| + | //2 | ||
| + | echo "2.Get the alt of the picture by its name:"; | ||
| + | echo $image-> | ||
| + | |||
| + | //3 | ||
| + | echo "3.Get the alt and size of the image by name:"; | ||
| + | $obj = $image-> | ||
| + | echo $obj-> | ||
| + | |||
| + | //end | ||
| + | echo "< | ||
| + | |||
| + | //Quit | ||
| + | $app-> | ||
| + | ?></ | ||
| + | |||
| + | Python example: <code python># Additional paths | ||
| + | import sys | ||
| + | sys.path.insert(0, | ||
| + | |||
| + | xhe_host = " | ||
| + | from xweb_human_emulator import * | ||
| + | |||
| + | # Start | ||
| + | echo("< | ||
| + | |||
| + | # 1 | ||
| + | echo(" | ||
| + | echo(browser.navigate(" | ||
| + | |||
| + | # 2 | ||
| + | echo(" | ||
| + | echo(image.get_by_name(" | ||
| + | |||
| + | # 3 | ||
| + | echo(" | ||
| + | obj = image.get_by_name(" | ||
| + | echo(obj.get_alt(), | ||
| + | echo(obj.get_width(), | ||
| + | echo(obj.get_height(), | ||
| + | |||
| + | # end | ||
| + | echo("< | ||
| + | |||
| + | # Quit | ||
| + | app.quit()</ | ||
| + | |||
| + | C# example: <code csharp># | ||
| + | |||
| + | 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 = " | ||
| + | InitXHE(); | ||
| + | |||
| + | //Start | ||
| + | echo("< | ||
| + | |||
| + | //1 step | ||
| + | echo(" | ||
| + | echo(browser.navigate(" | ||
| + | |||
| + | //step 2 | ||
| + | echo(" | ||
| + | echo(image.get_by_name(" | ||
| + | |||
| + | //step 3 | ||
| + | echo(" | ||
| + | XHEInterface obj = image.get_by_name(" | ||
| + | echo(obj.get_alt() + "" | ||
| + | |||
| + | //end | ||
| + | echo("< | ||
| + | |||
| + | app.quit(); | ||
| + | } | ||
| + | }</ | ||
| + | |||
| + | Java Script example: <code java>// | ||
| + | |||
| + | //connect the object to control the emulator, if not already connected | ||
| + | xhe_host = " | ||
| + | echo = require(" | ||
| + | |||
| + | //Start | ||
| + | echo("< | ||
| + | |||
| + | //1 step | ||
| + | echo(" | ||
| + | echo(browser.navigate(" | ||
| + | |||
| + | //step 2 | ||
| + | echo(" | ||
| + | echo(image.get_by_name(" | ||
| + | |||
| + | //step 3 | ||
| + | echo(" | ||
| + | obj = image.get_by_name(" | ||
| + | echo(obj.get_alt() + "" | ||
| + | |||
| + | //end | ||
| + | echo("< | ||
| + | |||
| + | //Quit | ||
| + | app.quit();</ | ||