Html element

description

Represents an HTML document.

syntax

newHtml(ELEMENT_NAME: string, URL: string)
  • ELEMENT_NAME: The name of the newly-created element.
  • URL : The URL of the HTML document.

since

beta 0.3

example(s)


@newHtml("intro", "example_intro.html")
@    .print()
+ Prints the content of the html file to the page.

Action commands

html.checkboxWarning

syntax

.checkboxWarning()

description

Defines the error message that gets displayed if an obligatory checkbox is not checked when calling warn. If you use %name% in the string it will be replaced with the element’s name.

example

click to expand

@newHtml("intro", "example_intro.html")
$    .checkboxWarning("It is highly recommended that you check the '%name%' box before continuing")
@    .radioWarning("Please consider selecting an option for '%name%'")
@    .inputWarning("We would like you to type some text in these fields")
@    .print()
@,
@newButton("I have completed the form")
@    .print()
@    .wait()
@    .remove()
@,
@getHtml("intro")
@    .warn()
@,
@newButton("Continue")
@    .print()
@    .wait()
  • Will print the custom warning messages on any missing obligatory field after clicking “I have completed the form.”
↑ back to top

html.inputWarning

syntax

.inputWarning()

description

Defines the error message that gets displayed if an obligatory input field is not filled when calling warn. If you use %name% in the string it will be replaced with the element’s name.

example

click to expand

@newHtml("intro", "example_intro.html")
@    .checkboxWarning("It is highly recommended that you check the '%name%' box before continuing")
$    .inputWarning("We would like you to type some text in these fields")
@    .radioWarning("Please consider selecting an option for '%name%'")
@    .print()
@,
@newButton("I have completed the form")
@    .print()
@    .wait()
@    .remove()
@,
@getHtml("intro")
@    .warn()
@,
@newButton("Continue")
@    .print()
@    .wait()
  • Will print the custom warning messages on any missing obligatory field after clicking “I have completed the form.”
↑ back to top

html.log

syntax

.log()

description

Will add a line at the end of the trial for each <textarea>, <input type='text'>, <input type='checkbox'> and <input type='radio'> in the document.

example

click to expand

@newHtml("feedback", "Feedback.html")
$    .log()
@    .print()
@,
@newButton("send", "Send")
@    .print()
@    .wait()
  • Adds the content of the file Feedback.html from the Resources (chunk_includes) folder of the Ibex project to the page and a Send button below it, and waits for a click on the button.
↑ back to top

html.radioWarning

syntax

.radioWarning()

description

Defines the error message that gets displayed if no radio button of an obligatory group is checked when calling warn. If you use %name% in the string it will be replaced with the element’s name.

example

click to expand

@newHtml("intro", "example_intro.html")
@    .checkboxWarning("It is highly recommended that you check the '%name%' box before continuing")
@    .inputWarning("We would like you to type some text in these fields")
$    .radioWarning("Please consider selecting an option for '%name%'")
@    .print()
@,
@newButton("I have completed the form")
@    .print()
@    .wait()
@    .remove()
@,
@getHtml("intro")
@    .warn()
@,
@newButton("Continue")
@    .print()
@    .wait()
  • Will print the custom warning messages on any missing obligatory field after clicking “I have completed the form.”
↑ back to top

html.warn

syntax

.warn()

description

Displays an error message for each of the obligatory fields from the HTML document that have not been filled yet. See the IBEX documentation about the Form controller for a discussion of how fields are set as obligatory.

example

click to expand

@newHtml("demographics", "example_intro.html")
@    .print()
@,
@newButton("continue", "Continue to the next page")
@    .print()
@    .wait(
@        getHtml("demographics").test.complete()
$            .failure( getHtml("demographics").warn() )
@    )
  • Prints the content of exampleintro.html_ onto the page and adds a Continue button below it. The button is validated only when all the obligatory fields from exampleintro.html_ have been filled.

  • If the button is clicked and at least one obligatory field has not been filled, the warn command is executed and will display an appropriate error message.

↑ back to top


Test commands

html.test.complete

syntax

.test.complete()

description

Tests whether all the obligatory fields form the HTML document have been filled. See the IBEX documentation about the Form controller for a discussion of how fields are set as obligatory.

example

click to expand

@newHtml("demographics", "example_intro.html")
@    .print()
@,
@newButton("continue", "Continue to the next page")
@    .print()
@    .wait(
$        getHtml("demographics").test.complete()
$            .failure( getHtml("demographics").warn() )
@    )
  • Prints the content of exampleintro.html_ onto the page and adds a Continue button below it. The button is validated only when all the obligatory fields from exampleintro.html_ have been filled.

  • If the button is clicked and at least one obligatory field has not been filled, the warn command is executed and will display an appropriate error message.

↑ back to top


Table of contents