The script begins by declaring a number of tabs:
DMBrowser tab0 = null; DMBrowser tab1 = null;
DMbrowser is a class and tab0 is the variable name.
Tabs.SetSize (1768, 746);
Declares size for all current and new tabs.
tab2 = Tabs.PopUps.Pop ["http://www.popuptest.com/popup1.html"];
Waits for a browser to open a new tab with URL as a parameter, meanwhile URL must correspond to that which has been set during script recording.
Created new tab “manually”.
tab0 = Tabs.NewTab ();
Step (1, "Yahoo - https://www.yahoo.com/");
Method for aggregation and further logical division of a script into parts, including logical division in reports. Step number shall be any number greater than zero.
Description – any string value.
Dmbrowser‘s class method has a string value and navigates inside the current tab (tab 0 in the example) to the specified address (URL).
Reflects transition to another URL during recording, initiated by a browser. It doesn’t force the browser to navigate. During playback, this method awaits transition (timeout 50 seconds). Often addresses contain dynamic parameters, that’s why it awaits transition, not to the specific URL but a fact of the transition itself. i.e. any string can be a parameter.
Accepts string as a parameter and searches it in “innertext” of a document (timeout 50 seconds).
tab1.KeywordAssert ("age will launch a total of 10 p");
Sends key press message to a browser. Key codes are taken from Enum Keys from System.Windows.Forms (https://goo.gl/bNdwR7).
tab0.TextField ("//INPUT[@ID=\"yschsp\"]", "//DIV[@ID=\"sbq-wrap\"]//INPUT[@TYPE=\"text\"]", "//LI[normalize-space()=\"pop-up test\"]/../../../../..//INPUT").TypeText ("popup test"); tab0.PressKey (Keys.Return);
Set of methods for interaction with the Document Object Model (DOM)
All methods check for compliance of a tag of the received element to an expected in a method:
Button (<button>)(<input type=”button, submit, reset”>)
Checkbox <input type=”checkbox”>
Element – ANY!!!
Image <image> <input type=”image”>
RadioButton <input type=”radio”>
TextField <textarea> <input type=”text”> <input>
TableCell <td> <th>
Frame <frame> <iframe>
RIA – EveryStepScripting Tool mode when it works not with HTML of a page but with coordinates which are determined by page size in pixels.
1st version of method accepts coordinates by X and Y axis
tab0.MouseMoveTo (884, 358);
2nd version of method accepts picture (image, page fragment captured during recording) and place cursor in the middle of this picture.
tab0.MouseMoveTo (PictureList );
3nd version of method accepts picture (image, page fragment captured during recording) and also accuracy coefficient
tab0.MouseMoveTo (PictureList , 0.97);
Accuracy Coefficient reflects a degree of coincidence sufficient for unique identification of a required fragment on visible part of the page. Default Value is 0.95. In case algorithm detects more than 1 coincidence with default Accuracy Coefficient either new fragment can be selected or Coefficient degree increased.
Places mouse cursor by coordinates relativeley to previous mouse cursos position.
tab0.MouseMove (23, 180);
After getting “IHtmlElement” few methods can be invoked:
Utilized only for SelectList method and accepts string parameter with desired option
Is used only with TextField
Similar to previous, enters the transferred text into the current textfield
Checked – only for CheckBox(), ticks and unticks checkbox
tab0.CheckBox(“xpath to the checkbox 1”).Checked = true;
TagName – reads tag for the current IHtmlElement