Element From Text

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
Line 5: Line 5:
 
'''Selector:''' The text representation for the selector.
 
'''Selector:''' The text representation for the selector.
  
== Example ==
+
== Example 1 ==
 
<pre>
 
<pre>
  
Line 21: Line 21:
  
 
[[File:elementfromtext.png]]
 
[[File:elementfromtext.png]]
 +
 +
 +
== Example 2 ==
 +
 +
<pre>
 +
navigate("http://www.google.com/", "Wait")
 +
add item to list(%list, "<name=q>", "Delete", "Global")
 +
wait(4)
 +
type text($element from text($list item(%list, 0)), "Hello there!", "Standard")
 +
</pre>
 +
 +
 +
In this example, the element from text function uses the selector in the list item at position 0 from "%list" to select the field on the page and fill the field with the type text command.

Revision as of 17:55, 24 May 2014

$Element Offset is a Browser Function.

This function converts a text representation of a selector into an actual selector.

Selector: The text representation for the selector.

Example 1


navigate("http://www.google.com/", "Wait")
wait(4)
set(#selector, "<name=q>", "Global")
type text($element from text(#selector), "Hello there!", "Standard")

The element from text function allows you to write your own selectors.

In this example, the element from text function uses the selector in the variable "#Selector" to select the field on the page and fill the field with the type text command.


File:Elementfromtext.png


Example 2

navigate("http://www.google.com/", "Wait")
add item to list(%list, "<name=q>", "Delete", "Global")
wait(4)
type text($element from text($list item(%list, 0)), "Hello there!", "Standard")


In this example, the element from text function uses the selector in the list item at position 0 from "%list" to select the field on the page and fill the field with the type text command.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox