IEClickTag
IEClickTag>IE_Reference,Frame,Form,Tagname,Attribute,Value,result
Simulates clicking an html element.
- IE_Reference: The identifier of the instance to use. IE_Reference must be an identifier value returned by IECreate, IEGetFromURL or IEWaitNew.
- Frame: The name of the frame containing the element
- Form: If a form object, the name of the form containing the element. Can be empty.
- Tagname: The element's tag name (e.g. 'A', 'IMG', 'INPUT')
Attribute takes any tag attribute, or one of the following values:
- 'TEXT' : identifies the element by the element's innertext property. If element's innertext matches value the element is clicked.
- 'HREF' : identifies the element by the href property. If element's href matches value the element is clicked.
- 'NAME' : identifies the element by its name property. If element's name matches value the element is clicked. In this case the element must also belong to the specified form.
- 'SRC' : identifies the element by the src property. If element's src property matches value the element is clicked.
- 'COORDS': for Area objects. If area's coords proprty matches value the element is clicked.
- 'RADIO' : For Radio objects. If element belongs to specified form and value matches "element_name:element_value" the element is clicked.
- 'CHECKBOX': For checkboxes. Works as with RADIO.
- 'TITLE' : identifies an 'A' element by its title property. If element's title matches value the element is clicked.
- 'ID' : identifies an element by its ID property. If elements ID matches the value specified the element is clicked.
- 'INDEX' : identifies an element by its zero based numeric index. This can be used if no other attribute can be used to identify the element uniquely. E.g. an INDEX of 0 for an A element will click the first link on the page, INDEX of 1 the next, and so on.
- 'CLASSNAME': identifies an element by its CLASSNAME property. If element's CLASSNAME matches the value specified the element is clicked.
Alternatively any other tag attribute can be used.
IEClickTag Example
//Click A tag with text "Log In" in IE[0] instance
IEClickTag>IE[0],,,A,TEXT,Log In,result
IEContainsText
IEContainsText>IE_Reference,Frame,Text,Result
Determines whether or not text is contained in the body of the page. Returns 1 if text is found, 0 if not.
IE_Reference: The identifier of the instance to use. IE_Reference must be an identifier value returned by IECreate, IEGetFromURL or IEWaitNew.
Specify a frame name to search within a specific frame. Leave frame blank if there are no frames.
IEContainsText Example
IEContainsText>IE[0],,Hello World,exists
IECreate
IECreate>New_IE_Reference_Variable
Creates a new IE instance, returning the instance handle in the given reference variable. Use this variable with subsequent IE functions to target the correct browser window.
IECreate Example
//Return new IE instance handle in IE0 variable
IECreate>IE[0]
IEExtractTable
IEExtractTable>IE_Reference,Frame,Index,Filename,RemoveCRLFs,Result
Extracts a table to a CSV file. Specify the number of the table on the page in index.
IE_Reference must be an identifier value returned by IECreate, IEGetFromURL or IEWaitNew.
Specify the frame name, or leave frame blank if no frame (top level document).
To remove carriage returns and line feeds from the output data set RemoveCRLFs to 1. Otherwise set RemoveCRLFs to 0.
Returns 0 if successful, 1 if an error occured.
IEExtractTable Example
IEExtractTable>IE[0],,21,c:\my documents\table.csv,1,r
IEExtractTableByName
IEExtractTableByName>IE_Reference,Frame,Name_Or_ID,Filename,RemoveCRLFs,Result
Extracts a table to a CSV file. Specify the name or ID of the table on the page in name_or_id.
IE_Reference must be an identifier value returned by IECreate, IEGetFromURL or IEWaitNew.
Specify the frame name, or leave frame blank if no frame (top level document).
To remove carriage returns and line feeds from the output data set RemoveCRLFs to 1. Otherwise set RemoveCRLFs to 0.
Returns 0 if successful, 1 if an error occured.
IEExtractTableByName Example
IEExtractTableByName>IE0,,customers,c:\my
documents\table.csv,1,r
IEExtractTag
IEExtractTag>IE_Reference,Frame,Tagname,Index,All,Result
Extracts text from the specified tag.
- IE_Reference: The identifier of the instance to use. IE_Reference must be an identifier value returned by IECreate, IEGetFromURL or IEWaitNew.
- Frame: the name of the frame to extract from
- Tagname: the html name of the tag to extract from (e.g. 'TD', 'BODY', 'A', 'P', 'TABLE', etc)
- Index: the index of the tag with tagname to extract from.
- All: if set to 1 extract all html, otherwise just innertext, or value for input fields.
IEExtractTag Example
IEExtractTag>IE[0],,TD,10,0,strTDContents
//Extracted text is invariable: strTDContents
IEExtractTagByAttrib>IE_Reference,Frame,Tagname,Attrib,Value,All,Result
Extracts text from the specified tag.
- IE_Reference: The identifier of the instance to use. IE_Reference must be an identifier value returned by IECreate, IEGetFromURL or IEWaitNew.
- Frame: the name of the frame to extract from
- Tagname: the html name of the tag to extract from (e.g. 'TD', 'BODY', 'A', 'P', 'TABLE', etc)
- Attrib: any valid tag attribute
- Value: the value of the specified tag attribute
- All: if set to 1 extract all html, otherwise just innertext, or value for input fields.
IEExtractTagByAttrib Example
IEExtractTagByAttrib>%IE[0]%,{""},{"INPUT"},{"NAME"},{"q"},1,buffer
MessageModal>buffer
IEExtractTagByName
IEExtractTagByName>IE_Reference,Frame,Tagname,Name_Or_ID,All,Result
Extracts text from the specified tag.
- IE_Reference: The identifier of the instance to use. IE_Reference must be an identifier value returned by IECreate, IEGetFromURL or IEWaitNew.
- Frame: the name of the frame to extract from
- Tagname: the html name of the tag to extract from (e.g. 'TD', 'BODY', 'A', 'P', 'TABLE', etc)
- Name_or_id: the name or id of the tag with tagname to extract from.
- All: if set to 1 extract all html, otherwise just innertext, or value for input fields.
- Result: the variable to return the text in
If the element is a checkbox and is checked ":CHECKED" will be appended to the result which will also contain the checkbox's value. i.e. result will contain "value:CHECKED".
IEExtractTagByName Example
IEExtractTagByName>IE[0],,DIV,sidebar,0,divside
MessageModal>Data: %divside%
IEFormFill
IEFormFill>IE_Reference,Frame,Form,Fieldname,Value,Event,Result
Fills a form field.
- IE_Reference: The identifier of the instance to use. IE_Reference must be an identifier value returned by IECreate, IEGetFromURL or IEWaitNew.
- Frame: the name of the frame to extract from
- Form: the name of the form (can be blank if the form has no name). Can also be set to "ACTION:action_script" where action_script is the action of the form (e.g. search.htm).
- Fieldname: the name of the field to fill. If the field has no name but has an ID attribute, the ID attributed can be specified instead. Alternatively you can specify the className of an element by issuing CLASSNAME:class where class is the className of the field.
- Value: the value to set the field value to.
- Event: optional parameter
that can take one of the following values:
- submit: forces the form to submit.
- onchange: triggers the field's onchange handler if it has one.
If the field is a SELECT object it is possible to select an item based on it's index, rather than actual value, by specifying fieldvalue as:
- #INDEX#:n where n is the zero based index of the item. To select all items in a multi-select SELECT object use #INDEX#:ALL
Returns the number of fields that matched the specified values if successful, 0 if unsuccessful.
IEFormFill Example
IEFormFill>IE[0],,main_form,firstname,Fred,0,r
IEFormSubmit
IEFormSubmit>IE_Reference,Frame,Form,Result
Submits a form. Usually this is done by clicking a Submit button or a link and therefore this function will not always be necessary as you'd probably use an IE_ClickTag instead. However, sometimes forms may be submitted in a different way, such as when the Enter key is pressed in the last field of the form. IE_FormSubmit can be used. Another way to do this is just to set the event parameter of IEFormFill to submit.
- IE_Reference: The identifier of the instance to use. IE_Reference must be an identifier value returned by IECreate, IEGetFromURL or IEWaitNew.
- Frame: the name of the frame to extract from
- Form: the name of the form (can be blank if the form has no name). Can also be set to "ACTION:action_script" where action_script is the action of the form (e.g. search.htm).
IEFormSubmit Example
IEFormFill>%IE[0]%,{""},{"ACTION:search.htm"},{"q"},{"fred"},0,ie_res
IEFormSubmit>%IE[0]%,{""},{"ACTION:search.htm"},ie_res
IEGetFromURL
IEGetFromURL>URL,IE_Reference
Returns a reference to an existing IE web browser instance. The instance is identified by the URL. URL can be full or partial. The first IE web browser document found whose URL contains or matches the URL specified will be used. The returned IE_Instance can be used with other WebRecorder functions.
IEGetFromURL Example
IEGetFromURL>www.somewhere.com,IE_Inst
IEClickTag>IE_Inst,,,A,TEXT,Log In,result
IEGetHWND
IEGetHWND>IE_Reference,Result
Returns the window handle of the specified IE instance.
IE_Reference must be an identifier value returned by IECreate, IEGetFromURL or IEWaitNew.
IEGetHWND Example
IEGetHwnd>IE[0],ie_handleIEGetTagPos
IEGetTagPos>IE_Reference,Frame,Tagname,Attrib,Value,Xpos,Ypos
Retrieves the screen X,Y position of the matching tag.
- IE_Reference: The identifier of the instance to use. IE_Reference must be an identifier value returned by IECreate, IEGetFromURL or IEWaitNew.
- Frame: the name of the frame to extract from
- Tagname: the html name of the tag to extract from (e.g. 'TD', 'BODY', 'A', 'P', 'TABLE', etc)
- Attrib: the identifying attribute of the element e.g. innerText or ID. (TEXT can be used for innerText). Alternatively this can be INDEX to identify the element by 0-based numeric index where no unique attributes exist.
- Value: the value of the given attribute.
Note: Note that the position returned will be the top left position of the element. You may need to apply a small offset for a mouse over to be triggered.
IEGetTagPos Example
IEGetTagPos>%IE[2]%,{""},{"A"},{"TEXT"},{"Home"},tagX,tagY
MouseMove>tagX,tagY
IEGetURL
IEGetURL>IE_Reference,Result
Returns the URL of the specified IE instance.
IE_Reference must be an identifier value returned by IECreate, IEGetFromURL or IEWaitNew.
IEGetURL Example
IEGetURL>IE[0],ie_handle
IEGoBack
IEGoBack>IE_Reference,Result
Navigates the given IE web browser instance back one page. Same as clicking the back button. Returns zero if successful, one if an error occurs.
IE_Reference must be an identifier value returned by IECreate, IEGetFromURL or IEWaitNew.
IEGoBack Example
//Go back one page in IE[0] instance
IEGoBack>IE[0],result
IEGoForward
IEGoForward>IE_Reference,Result
Navigates the given IE web browser instance forward one page. Same as clicking the forward button. Returns zero if successful, one if an error occurs.
IE_Reference must be an identifier value returned by IECreate, IEGetFromURL or IEWaitNew.
IEGoForward Example
//Go forward one page in IE[0] instance
IEGoForward>IE[0],result
IENavigate
IENavigate>IE_Reference,URL,Result
Navigates the specified browser instance to URL. Returns 0 if successful, 1 if not.
IE_Reference must be an identifier value returned by IECreate, IEGetFromURL or IEWaitNew.
IENavigate Example
//Navigate IE0 instance
IENavigate>IE[0],http://www.cyara.com/,ie_res
IEQuit
IEQuit>IE_Reference,result
Closes the specified IE window
IE_Reference must be an identifier value returned by IECreate, IEGetFromURL or IEWaitNew.
IEQuit Example
//Quit IE[0] instance IEQuit>IE[0],ie_res
IERefresh
IERefresh>IE_Reference,Result
Refreshes the page - does the same as clicking the refresh button on the web browser specified by it's identifier. Returns 0 if successful, 1 if an error occurred.
IE_Reference must be an identifier value returned by IECreate, IEGetFromURL or IEWaitNew.
IERefresh Example
//Go forward one page in IE[0] instance
IERefresh>IE[0],result
IESetTimeout
IESetTimeout>Timeout,Result
Sets the timeout in seconds to use for IEClickTag, IEFormFill and IEWaitDocumentComplete
To help ensure IEAuto does not try to click or fill tags before they exist IEClickTag and IEFormFill will wait until they exist, or timeout within the time specified by IESetTimeout. IEWaitDocumentComplete also uses this timeout to prevent hangs should a page fail to load.
IESetTimeout Example
//Set timeout for ClickTag and FormFill to 10 seconds, increase if pages load more slowly
IESetTimeout>10,ie_res
IEShowIE
IEShowIE>IE_Reference,Show
ShowIE allows you to show or hide an IE instance. Set Visible to 0 to hide the instance, and 1 to show it. IECreate always creates IE in visible mode so use IEShowIE immediately after IECreate to hide it.
IE_Reference must be an identifier value returned by IECreate, IEGetFromURL or IEWaitNew.
IEShowIE Example
//Hide IE[0] instance IEShowIE>IE[0],0
IEWait
IEWait>IE_Reference/URL
Waits for the specified browser instance to no longer be busy by monitoring IE's busy property. (Can take a URL instead of IE instance).
IE_Reference must be an identifier value returned by IECreate, IEGetFromURL or IEWaitNew.
Note:
Note that waiting for IE to not be busy is not necessarily the same as waiting for the overall document to be complete. For waiting for document completeness we recommend using IEWaitDocumentComplete.IEWait Example
//Wait for IE[0] instance IEWait>IE[0]
IEWaitDocumentComplete
IEWaitDocumentComplete>IE_Reference,Result
Waits for the document in the given web browser instance to have completely finished loading.
IE_Reference must be an identifier value returned by IECreate, IEGetFromURL or IEWaitNew.
This function will timeout if the value set by IESetTimeout elapses before the document has loaded. It will return 0 if it times out, 1 if successful.
This is output by WebRecorder automatically after every document load.
IEWaitDocumentComplete Example
IENavigate>%IE[0]%,www.cyara.com,ie_res
IEWaitDocumentComplete>%IE[0]%,ie_res
IEWaitForText
IEWaitForText>IE_Reference,Frame,Text,All,Timeout,Result
Waits for the specified text to exist in the body of the page before continuing.
- IE_Reference must be an identifier value returned by IECreate, IEGetFromURL or IEWaitNew.
- Frame: the name of the frame to extract from
- Text: the text to wait for
- All: if set to 1 look in all html otherwise just text
- Timeout: number of seconds to wait
Returns 1 if the text was found within the given timeout seconds. If it times out it will return 0.
IEWaitForText Example
IEWaitForText>IE[0],,{"Log in"},0,20,result
IEWaitTimeout
IEWaitTimeout>IE_Reference,Timeout_Seconds,Post_Seconds,Result
Waits for the specified browser instance to no longer be busy by monitoring IE's busy property. Will timeout if timeout_seconds seconds elapses before IE returns not busy. Returns 1 if the command timed out before the browser ceased being busy.
IE_Reference must be an identifier value returned by IECreate, IEGetFromURL or IEWaitNew.
Waits post_seconds afterwards.
Note: Note that waiting for IE to not be busy is not necessarily the same as waiting for the overall document to be complete. For waiting for document completeness we recommend using IEWaitDocumentComplete
IEWaitTimeout Example
//Wait for IE[0] instance with 30 second timeout, and 1 second post delay
IEWaitTimeout>IE[0],30,1,res
IEWaitNew
IEWaitNew>New_IE_Reference
Waits for a new IE WebBrowser object to be created. This is needed where a call to one of the other functions, such as IEClickTag or IEFormFill results in a new Internet Explorer window being created. E.g. the response to a ClickTag could be a new popup. Call IEWaitNew to wait for this new instance to be created. Returns an identifier to the new instance. Reserved is undefined - set to zero.
IEWaitNew Example
//Wait for IE[0] instance with 30 second timeout, and 1 second post
delay IEWaitTimeout>IE[0],30,1,res
Comments
0 comments
Please sign in to leave a comment.