> For the complete documentation index, see [llms.txt](https://kaliostest-nouvelle-version.gitbook.io/manuel-utilisateur/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kaliostest-nouvelle-version.gitbook.io/manuel-utilisateur/chapitre-8-le-textengine/utilisation-dune-action.md).

# Utilisation d’une action

Toutes les actions Web, Mobile et Desktop de la librairie Kalios sont disponibles.

Chaque action renvoi un tableau de taille 3 comportant : \[nom de l’action, statut (OK,WARNING ou KO), message erreur]

Si vous souhaitez les utiliser, il suffit de suivre ce format : NomAction(“propriété”, “paramètre”)

Vous pouvez stocker le retour de l’action dans une variable :&#x20;

```java
String[] statut = NomAction(“propriété”, “paramètre”)
```

Vous pouvez stocker l’état de réussite ou d’échec dans une variable :&#x20;

```java
String statut = NomAction(“propriété”, “paramètre”)[1]
```

Vous pouvez stocker le message d’erreur dans une variable :&#x20;

```java
String statut = NomAction(“propriété”, “paramètre”)[2]
```

### Exemple :&#x20;

L’action suivante écrira le texte Manteau dans le champ Search :

```java
sendkeysbytext(“Search”, “Manteau”)
```

Suivant l’action que vous sélectionnez, la propriété peut être un texte, un name, un id, un xpath ou le nom d’un objet contenu dans le fichier des objets (voir chapitre "Le fichier des objets").

Exemple :&#x20;

L’action suivante écrira le texte Manteau dans le champ dont l’id est Search :

```java
sendkeysbyid(“Search”, “Manteau”)
```

Les actions ne pouvant pas recevoir de paramètre s’écrivent :

```java
NomAction(“propriété”)
```

Exemple :&#x20;

L’action suivante cliquera sur le texte Solde :

```java
clickbytext(“Solde”)
```

Il est important de remplir tous les champs demandés, si vous ne souhaitez pas mettre de propriété ou de paramètre, vous pouvez mettre “ ”(sans espaces).

Exemple :

Cette action fermera le navigateur :&#x20;

```java
close(“”)
```

Vous pourrez retrouver toute la documentation des actions Kalios juste [ici](/manuel-utilisateur/chapitre-4-documentation-de-reference-des-actions.md).

La variabilisation des attributs est disponible de la même façon que sur KaliosWeb

Dans le dossier additional\_files, vous trouverez un fichier variables.ini . C’est ici que vous allez pouvoir définir vos variables dans la section appropriée.

<figure><img src="https://lh7-us.googleusercontent.com/gyeLIbLrMiHuSVtr8EQ4e4PAq8iWHvKX_GLwvVGJ4FQCWCM0FTtHJFrq-NvtGrmFj0UWMb5c55751lOIGauloDEZiEllGt0Jffpvsg9YW4LU_eijIX88Q2KkkuKGjCEJLby6wj6gttrUXIhiz_20xBA" alt=""><figcaption></figcaption></figure>

Pour l’utiliser, il suffit d’écrire $article1

Exemple :&#x20;

Cette action cliquera sur le texte manteau :

```java
clickbytext(“$article1”)
```

Utilisation de plusieurs parcours

Vous pouvez au cours d’une exécution changer de parcours avec la fonction :  ChangeParcours(“parcours 2”)

### Utilisation de plusieurs parcours

On pourrait donc faire par exemple :&#x20;

Parcours 1 :&#x20;

* Ecrire Juno Jacket dans barre recherche&#x20;
* cliquer sur Search
* cliquer sur juno jacket

Parcours 2 :&#x20;

* choisir taille XS
* choisir couleur bleu
* ajouter panier
* fermer navigateur

Voici un exemple :

<pre class="language-java"><code class="lang-java"><strong>public class MainWeb {
</strong>    public static void main(String[] args) throws IOException, InterruptedException {
    
        initWeb("https://magento.softwaretestingboard.com/", "chercherarticle");
        Chercherarticle();
        ChangeParcours("AjouterPanier") ;
        AjouterPanier();
        ShowResult() ;
    }
    
    
    public static void Chercherarticle() throws IOException, InterruptedException {
        sendkeysbytext("Search Entire Store", "Juno Jacket");
        clickbytext("Search");
        clickbytext("Juno Jacket");
    }
    
    
    public static void AjouterPanier() throws IOException, InterruptedException {
        clickbytext("XS");
        clickbytext("blue");
        clickbytext("add to cart");
        close("");
}
</code></pre>

<br>

Cela permet de réaliser plusieurs tests dans la même exécution tout en séparant les résultats dans 2 fichiers différents.

\ <br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kaliostest-nouvelle-version.gitbook.io/manuel-utilisateur/chapitre-8-le-textengine/utilisation-dune-action.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
