diff --git a/source/src/main/resources/documentation/D3/documentation_en.adoc b/source/src/main/resources/documentation/D3/documentation_en.adoc index 9ef5ce0425..d4140628c9 100644 --- a/source/src/main/resources/documentation/D3/documentation_en.adoc +++ b/source/src/main/resources/documentation/D3/documentation_en.adoc @@ -19,16 +19,24 @@ We are happy to welcome new contributors! ================================================= --- -= Execution Use Case -:file-to-include: howto_exe_{lang}.adoc += Manage property on Testcase + +:file-to-include: howto_property_{lang}.adoc include::include/{lang}/{file-to-include}[] -link:{repo-url}/{file-to-include}[image:edit-doc.png[FR,20,20]^] _{contribution-message}_ +== Use static string (text) +:file-to-include: howto_property_text_static_{lang}.adoc +include::include/{lang}/{file-to-include}[] -== From SaaS Instance to my local Selenium/Appium installation -:file-to-include: howto_exe_localexecution_{lang}.adoc +== Generate random string with defined length (text) +:file-to-include: howto_property_text_random_{lang}.adoc include::include/{lang}/{file-to-include}[] +== Get information from Web Page (getFromHTML) +:file-to-include: howto_property_html_{lang}.adoc +include::include/{lang}/{file-to-include}[] + + link:{repo-url}/{file-to-include}[image:edit-doc.png[FR,20,20]^] _{contribution-message}_ --- diff --git a/source/src/main/resources/documentation/D3/images/property_html_attribute_random.png b/source/src/main/resources/documentation/D3/images/property_html_attribute_random.png new file mode 100644 index 0000000000..d90e1b341d Binary files /dev/null and b/source/src/main/resources/documentation/D3/images/property_html_attribute_random.png differ diff --git a/source/src/main/resources/documentation/D3/images/property_html_attribute_static_0.png b/source/src/main/resources/documentation/D3/images/property_html_attribute_static_0.png new file mode 100644 index 0000000000..325b17cb37 Binary files /dev/null and b/source/src/main/resources/documentation/D3/images/property_html_attribute_static_0.png differ diff --git a/source/src/main/resources/documentation/D3/images/property_html_attribute_static_n.png b/source/src/main/resources/documentation/D3/images/property_html_attribute_static_n.png new file mode 100644 index 0000000000..95a7ebde67 Binary files /dev/null and b/source/src/main/resources/documentation/D3/images/property_html_attribute_static_n.png differ diff --git a/source/src/main/resources/documentation/D3/images/property_html_coord_random.png b/source/src/main/resources/documentation/D3/images/property_html_coord_random.png new file mode 100644 index 0000000000..bb3b4c1be5 Binary files /dev/null and b/source/src/main/resources/documentation/D3/images/property_html_coord_random.png differ diff --git a/source/src/main/resources/documentation/D3/images/property_html_coord_static_0.png b/source/src/main/resources/documentation/D3/images/property_html_coord_static_0.png new file mode 100644 index 0000000000..3c7221cda5 Binary files /dev/null and b/source/src/main/resources/documentation/D3/images/property_html_coord_static_0.png differ diff --git a/source/src/main/resources/documentation/D3/images/property_html_coord_static_n.png b/source/src/main/resources/documentation/D3/images/property_html_coord_static_n.png new file mode 100644 index 0000000000..79af0a07a7 Binary files /dev/null and b/source/src/main/resources/documentation/D3/images/property_html_coord_static_n.png differ diff --git a/source/src/main/resources/documentation/D3/images/property_html_count.png b/source/src/main/resources/documentation/D3/images/property_html_count.png new file mode 100644 index 0000000000..c0634d307c Binary files /dev/null and b/source/src/main/resources/documentation/D3/images/property_html_count.png differ diff --git a/source/src/main/resources/documentation/D3/images/property_html_raw_random.png b/source/src/main/resources/documentation/D3/images/property_html_raw_random.png new file mode 100644 index 0000000000..d7b57e80b4 Binary files /dev/null and b/source/src/main/resources/documentation/D3/images/property_html_raw_random.png differ diff --git a/source/src/main/resources/documentation/D3/images/property_html_raw_static_0.png b/source/src/main/resources/documentation/D3/images/property_html_raw_static_0.png new file mode 100644 index 0000000000..0f40ecc57f Binary files /dev/null and b/source/src/main/resources/documentation/D3/images/property_html_raw_static_0.png differ diff --git a/source/src/main/resources/documentation/D3/images/property_html_raw_static_n.png b/source/src/main/resources/documentation/D3/images/property_html_raw_static_n.png new file mode 100644 index 0000000000..6df1a2980b Binary files /dev/null and b/source/src/main/resources/documentation/D3/images/property_html_raw_static_n.png differ diff --git a/source/src/main/resources/documentation/D3/images/property_html_rawlist.png b/source/src/main/resources/documentation/D3/images/property_html_rawlist.png new file mode 100644 index 0000000000..6f8a454060 Binary files /dev/null and b/source/src/main/resources/documentation/D3/images/property_html_rawlist.png differ diff --git a/source/src/main/resources/documentation/D3/images/property_html_value_random.png b/source/src/main/resources/documentation/D3/images/property_html_value_random.png new file mode 100644 index 0000000000..f136a944ae Binary files /dev/null and b/source/src/main/resources/documentation/D3/images/property_html_value_random.png differ diff --git a/source/src/main/resources/documentation/D3/images/property_html_value_static_0.png b/source/src/main/resources/documentation/D3/images/property_html_value_static_0.png new file mode 100644 index 0000000000..132c8b6ee4 Binary files /dev/null and b/source/src/main/resources/documentation/D3/images/property_html_value_static_0.png differ diff --git a/source/src/main/resources/documentation/D3/images/property_html_value_static_n.png b/source/src/main/resources/documentation/D3/images/property_html_value_static_n.png new file mode 100644 index 0000000000..955e7e7ed1 Binary files /dev/null and b/source/src/main/resources/documentation/D3/images/property_html_value_static_n.png differ diff --git a/source/src/main/resources/documentation/D3/images/property_html_valuelist.png b/source/src/main/resources/documentation/D3/images/property_html_valuelist.png new file mode 100644 index 0000000000..324aeeb4a9 Binary files /dev/null and b/source/src/main/resources/documentation/D3/images/property_html_valuelist.png differ diff --git a/source/src/main/resources/documentation/D3/images/property_text_random.png b/source/src/main/resources/documentation/D3/images/property_text_random.png new file mode 100644 index 0000000000..e008033981 Binary files /dev/null and b/source/src/main/resources/documentation/D3/images/property_text_random.png differ diff --git a/source/src/main/resources/documentation/D3/images/property_text_random2.png b/source/src/main/resources/documentation/D3/images/property_text_random2.png new file mode 100644 index 0000000000..f5a73b71d7 Binary files /dev/null and b/source/src/main/resources/documentation/D3/images/property_text_random2.png differ diff --git a/source/src/main/resources/documentation/D3/images/property_text_random_action.png b/source/src/main/resources/documentation/D3/images/property_text_random_action.png new file mode 100644 index 0000000000..34689d14ab Binary files /dev/null and b/source/src/main/resources/documentation/D3/images/property_text_random_action.png differ diff --git a/source/src/main/resources/documentation/D3/images/property_text_static.png b/source/src/main/resources/documentation/D3/images/property_text_static.png new file mode 100644 index 0000000000..7b01c5a9d5 Binary files /dev/null and b/source/src/main/resources/documentation/D3/images/property_text_static.png differ diff --git a/source/src/main/resources/documentation/D3/images/property_text_static_action.png b/source/src/main/resources/documentation/D3/images/property_text_static_action.png new file mode 100644 index 0000000000..425781f427 Binary files /dev/null and b/source/src/main/resources/documentation/D3/images/property_text_static_action.png differ diff --git a/source/src/main/resources/documentation/D3/include/en/howto_property_en.adoc b/source/src/main/resources/documentation/D3/include/en/howto_property_en.adoc new file mode 100644 index 0000000000..660f106108 --- /dev/null +++ b/source/src/main/resources/documentation/D3/include/en/howto_property_en.adoc @@ -0,0 +1,9 @@ +Variabilizing data is essential for building robust and efficient automated test. It provide Flexibility, Reusability and Maintainability : + +** *Dynamic Data:* Imagine you have a test that checks that different user can login. Instead of hardcoding each steps, you can use variables and use the same step without rewriting the entire test script. + +** *Multiple Scenarios:* You can use variables to run the same test with different inputs, like different user names, passwords, or product IDs. This helps you cover a wider range of scenarios without creating separate tests for each variation. + +** *Clearer Scenarios:* Variables make your test scripts more readable. Instead of seeing hardcoded values scattered throughout, you have meaningful names like username , password , or product_id . This makes it easier to understand what the test is doing. + +** *Easy Updates:* If you need to change a value, you only need to update the variable definition, not every place it's used in the test. This saves time and reduces the risk of errors. \ No newline at end of file diff --git a/source/src/main/resources/documentation/D3/include/en/howto_property_html_en.adoc b/source/src/main/resources/documentation/D3/include/en/howto_property_html_en.adoc new file mode 100644 index 0000000000..4fe64e4d60 --- /dev/null +++ b/source/src/main/resources/documentation/D3/include/en/howto_property_html_en.adoc @@ -0,0 +1,269 @@ + +=== Get value from HTML Element + +==== Get value from first HTML Element + +This property type retrieves the value from the first HTML element that matches a specified selector. It takes an id, class, name, or any xpath as an argument, searches the DOM for the first matching element, and returns its value. If no element is found, it returns NA, could not find . This function is useful for quickly accessing form inputs or text content from the first occurrence of a specific HTML element in the document. + +* 1 - Define a property + +*** Type : Choose *getFromHtml* option +*** Element Type : Choose *Value* option +*** Nature : Choose *Static* option +*** Rank : Keep *0* +*** Value : Put the xpath (or any identifier) to retrieve the element + +image:property_html_value_static_0.png[Logo] + +* 2 - Then, use in in the scenario + +image:property_text_static_action.png[Logo] + +==== Get value from specific HTML Element + +This property type retrieves the value from a specific HTML element (defined in rank field) that matches a specified selector. It takes an id, class, name, or any xpath as an argument, searches the DOM for the first matching element, and returns its value. If no element is found, it returns NA, could not find . This function is useful for quickly accessing form inputs or text content from a specific HTML element in the document. + +* 1 - Define a property + +*** Type : Choose *getFromHtml* option +*** Element Type : Choose *Value* option +*** Nature : Choose *Static* option +*** Rank : Put an Integer, which is the element number that is retrieved +*** Value : Put the xpath (or any identifier) to retrieve the element + +image:property_html_value_static_n.png[Logo] + +* 2 - Then, use in in the scenario + +image:property_text_static_action.png[Logo] + +==== Get value from random HTML Element + +This property type retrieves the value from a random HTML element (defined in rank field) that matches a specified selector. It takes an id, class, name, or any xpath as an argument, searches the DOM for the first matching element, and returns its value. If no element is found, it returns NA, could not find . This function is useful for quickly accessing form inputs or text content from a random HTML element matching criteria in the document. + +* 1 - Define a property + +*** Type : Choose *getFromHtml* option +*** Element Type : Choose *Value* option +*** Nature : Choose *Random* option +*** Value : Put the xpath (or any identifier) to retrieve the element + +image:property_html_value_random.png[Logo] + +* 2 - Then, use in in the scenario + +image:property_text_static_action.png[Logo] + +=== Get raw element from HTML + +==== Get raw element from first HTML Element + +This property type retrieves the raw HTML element from the first HTML element that matches a specified selector. It takes an id, class, name, or any xpath as an argument, searches the DOM for the first matching element, and returns the HTML code of the element as a string. If no element is found, it returns NA, could not find . This function is useful for inspecting the structure of an HTML element and extracting the HTML code for further processing. + +* 1 - Define a property + +*** Type : Choose *getFromHtml* option +*** Element Type : Choose *Raw* option +*** Nature : Choose *Static* option +*** Rank : Keep 0 +*** Value : Put the xpath (or any identifier) to retrieve the element + +image:property_html_raw_static_0.png[Logo] + +* 2 - Then, use in in the scenario + +image:property_text_static_action.png[Logo] + +==== Get raw element from specific HTML Element + +This property type retrieves the raw HTML element from a specific HTML element (defined in rank field) that matches a specified selector. It takes an id, class, name, or any xpath as an argument, searches the DOM for the first matching element, and returns the HTML code of the element as a string. If no element is found, it returns NA, could not find . This function is useful for inspecting the structure of a specific HTML element and extracting the HTML code for further processing. + +* 1 - Define a property + +*** Type : Choose *getFromHtml* option +*** Element Type : Choose *Raw* option +*** Nature : Choose *Static* option +*** Rank : Put an Integer, which is the element number that is retrieved +*** Value : Put the xpath (or any identifier) to retrieve the element + +image:property_html_raw_static_n.png[Logo] + +* 2 - Then, use in in the scenario + +image:property_text_static_action.png[Logo] + +==== Get raw element from random HTML Element + +This property type retrieves the raw HTML element from a random HTML element (defined in rank field) that matches a specified selector. It takes an id, class, name, or any xpath as an argument, searches the DOM for the first matching element, and returns the HTML code of the element as a string. If no element is found, it returns NA, could not find . This function is useful for inspecting the structure of a random HTML element matching criteria and extracting the HTML code for further processing. + +* 1 - Define a property + +*** Type : Choose *getFromHtml* option +*** Element Type : Choose *Raw* option +*** Nature : Choose *Random* option +*** Value : Put the xpath (or any identifier) to retrieve the element + +image:property_html_raw_random.png[Logo] + +* 2 - Then, use in in the scenario + +image:property_text_static_action.png[Logo] + +=== Get position of HTML element + +==== Get position of first HTML Element + +This property type retrieves the position (x,y) in pixel of the first HTML element that matches a specified selector, relative to the top left corner of the browser window. It takes an id, class, name, or any xpath as an argument, searches the DOM for the first matching element, and returns a tuple containing the x and y coordinates of the top-left corner of the element. If no element is found, it returns NA, could not find . This function is useful for determining the location of an element on the page and for interacting with it programmatically. + +* 1 - Define a property + +*** Type : Choose *getFromHtml* option +*** Element Type : Choose *Coordinate* option +*** Nature : Choose *Static* option +*** Rank : Keep 0 +*** Value : Put the xpath (or any identifier) to retrieve the element + +image:property_html_coord_static_0.png[Logo] + +* 2 - Then, use in in the scenario + +image:property_text_static_action.png[Logo] + +==== Get position of specific HTML Element + +This property type retrieves the position (x,y) in pixel of a specific HTML element (defined in rank field) that matches a specified selector, relative to the top left corner of the browser window. It takes an id, class, name, or any xpath as an argument, searches the DOM for the first matching element, and returns a tuple containing the x and y coordinates of the top-left corner of the element. If no element is found, it returns NA, could not find . This function is useful for determining the location of a specific element on the page and for interacting with it programmatically. + +* 1 - Define a property + +*** Type : Choose *getFromHtml* option +*** Element Type : Choose *Coordinate* option +*** Nature : Choose *Static* option +*** Rank : Put an Integer, which is the element number that is retrieved +*** Value : Put the xpath (or any identifier) to retrieve the element + +image:property_html_coord_static_n.png[Logo] + +* 2 - Then, use in in the scenario + +image:property_text_static_action.png[Logo] + +==== Get position of random HTML Element + +This property type retrieves the position (x,y) in pixel of a random HTML element (defined in rank field) that matches a specified selector, relative to the top left corner of the browser window. It takes an id, class, name, or any xpath as an argument, searches the DOM for the first matching element, and returns a tuple containing the x and y coordinates of the top-left corner of the element. If no element is found, it returns NA, could not find . This function is useful for determining the location of a random element matching criteria on the page and for interacting with it programmatically. + +* 1 - Define a property + +*** Type : Choose *getFromHtml* option +*** Element Type : Choose *Coordinate* option +*** Nature : Choose *Random* option +*** Value : Put the xpath (or any identifier) to retrieve the element + +image:property_html_coord_random.png[Logo] + +2 - Then, use in in the scenario + +image:property_text_static_action.png[Logo] + +=== Get attribute of HTML element + +==== Get attribute of first HTML Element + +This property type retrieves the value of a specific attribute from the first HTML element that matches a specified selector. It takes an id, class, name, or any xpath as an argument, searches the DOM for the first matching element, and returns the value of the specified attribute. If no element is found or the attribute is not found, it returns NA, could not find . This function is useful for accessing specific attributes of HTML elements, such as the 'href' attribute of a link or the 'src' attribute of an image. + +* 1 - Define a property + +*** Type : Choose *getFromHtml* option +*** Element Type : Choose *Attribute* option +*** Nature : Choose Static option +*** Rank : Keep 0 +*** Attribute Name : Put the attibute name +*** Value : Put the xpath (or any identifier) to retrieve the element *** Attribute : Put the attribute name to retrieve + +image:property_html_attribute_static_0.png[Logo] + +* 2 - Then, use in in the scenario + +image:property_text_static_action.png[Logo] + +==== Get attribute of specific HTML Element + +This property type retrieves the value of a specific attribute from a specific HTML element (defined in rank field) that matches a specified selector. It takes an id, class, name, or any xpath as an argument, searches the DOM for the first matching element, and returns the value of the specified attribute. If no element is found or the attribute is not found, it returns NA, could not find . This function is useful for accessing specific attributes of a specific HTML element, such as the 'href' attribute of a link or the 'src' attribute of an image. + +* 1 - Define a property + +*** Type : Choose *getFromHtml* option +*** Element Type : Choose *Attribute* option +*** Nature : Choose *Static* option +*** Rank : Put an Integer, which is the element number that is retrieved +*** Attribute Name : Put the attibute name +*** Value : Put the xpath (or any identifier) to retrieve the element *** Attribute : Put the attribute name to retrieve + +image:property_html_attribute_static_n.png[Logo] + +* 2 - Then, use in in the scenario + +image:property_text_static_action.png[Logo] + +==== Get attribute of random HTML Element + +This property type retrieves the value of a specific attribute from a random HTML element that matches a specified selector. It takes an id, class, name, or any xpath as an argument, searches the DOM for the first matching element, and returns the value of the specified attribute. If no element is found or the attribute is not found, it returns NA, could not find . This function is useful for accessing specific attributes of a random HTML element matching criteria, such as the 'href' attribute of a link or the 'src' attribute of an image. + +* 1 - Define a property + +*** Type : Choose *getFromHtml* option +*** Element Type : Choose *Attribute* option +*** Nature : Choose *Random* option +*** Attribute Name : Put the attibute name +*** Value : Put the xpath (or any identifier) to retrieve the element *** Attribute : Put the attribute name to retrieve + +image:property_html_attribute_random.png[Logo] + +* 2 - Then, use in in the scenario + +image:property_text_static_action.png[Logo] + +=== Get number of HTML element found + +This property type retrieves the number of HTML elements found on the page that match a specified selector. It takes an id, class, name, or any xpath as an argument and returns the number of matching elements. If no element is found, it returns 0. This function is useful for determining the number of elements on the page that meet specific criteria, such as the number of links on a page or the number of images in a specific section. + +* 1 - Define a property +*** Type : Choose *getFromHtml* option +*** Element Type : Choose *Count* option +*** Value : Put the xpath (or any identifier) to retrieve the element + +image:property_html_count.png[Logo] + +* 2 - Then, use in in the scenario + +image:property_text_static_action.png[Logo] + +=== Get table of value of all HTML element found + +This property type retrieves the values of all HTML elements found on the page that match a specified selector and returns them as a table. It takes an id, class, name, or any xpath as an argument, searches the DOM for all matching elements, and returns a table where each row represents a found element and each column represents a specific attribute of that element. If no element is found, it returns an empty table. This function is useful for extracting data from a list of elements, such as the text content of all links on a page or the image URLs of all images in a gallery. + +* 1 - Define a property +*** Type : Choose getFromHtml option +*** Element Type : Choose *Value List* option +*** Value : Put the xpath (or any identifier) to retrieve the element + + +image:property_html_valuelist.png[Logo] + +* 2 - Then, use in in the scenario + +image:property_text_static_action.png[Logo] + +=== Get all HTML element found in raw format + +This property type retrieves all HTML elements found on the page that match a specified selector and returns them as a list of strings. It takes an id, class, name, or any xpath as an argument, searches the DOM for all matching elements, and returns a list containing the raw HTML code of each element. If no element is found, it returns an empty list. This function is useful for inspecting the structure of all matching elements and for extracting the HTML code for further processing. + +* 1 - Define a property +*** Type : Choose getFromHtml option +*** Element Type : Choose *Raw List* option +*** Value : Put the xpath (or any identifier) to retrieve the element + +image:property_html_rawlist.png[Logo] + +* 2 - Then, use in in the scenario + +image:property_text_static_action.png[Logo] \ No newline at end of file diff --git a/source/src/main/resources/documentation/D3/include/en/howto_property_text_random_en.adoc b/source/src/main/resources/documentation/D3/include/en/howto_property_text_random_en.adoc new file mode 100644 index 0000000000..747284f646 --- /dev/null +++ b/source/src/main/resources/documentation/D3/include/en/howto_property_text_random_en.adoc @@ -0,0 +1,31 @@ +In case you need to generate a random String + +=== Generate random String with any alpha numeric characters + +* 1 - Define a Random property + +*** Type : Choose *text* option +*** Nature : Choose *Random* option +*** Length : Define the number of character you want to retrieve +*** Value : Keep empty + +image:property_text_random.png[Logo] + +* 2 - Then, use in in the scenario + +image:property_text_random_action.png[Logo] + +=== Generate random String with specific alpha numeric characters + +* 1 - Define a Random property + +*** Type : Choose *text* option +*** Nature : Choose *Random* option +*** Length : Define the number of character you want to retrieve +*** Value : Put the characters that will be used to generate random string (case sensitive) + +image:property_text_random2.png[Logo] + +* 2 - Then, use in in the scenario + +image:property_text_random_action.png[Logo] \ No newline at end of file diff --git a/source/src/main/resources/documentation/D3/include/en/howto_property_text_static_en.adoc b/source/src/main/resources/documentation/D3/include/en/howto_property_text_static_en.adoc new file mode 100644 index 0000000000..732e6f5f22 --- /dev/null +++ b/source/src/main/resources/documentation/D3/include/en/howto_property_text_static_en.adoc @@ -0,0 +1,15 @@ +You may have to use same step implementation with different data on different context (country for exemple). Or re-use the same step on other testcase (See how to add a Step in Library) + +=== Generate static String + +* 1 - Define a Static property + +*** Type : Choose *text* option +*** Nature : Choose *Static* option +*** Value : Put the String you want to retreive + +image:property_text_static.png[Logo] + +* 2 - Then, use in in the scenario + +image:property_text_static_action.png[Logo] \ No newline at end of file