# Intégrer vos propres actions à Kaliostest

Le code des actions se trouve dans le script technique présent dans le répertoire scripts\_techniques. Il y a un script technique pour les actions web dans le dossier Selenium, un script technique pour les actions mobiles dans le dossier Appium et un script technique pour les actions Desktop dans le dossier Desktop.&#x20;

Si vous souhaitez ajouter de nouvelles actions, il faut modifier les fichiers sources. Dans un premier temps, vous pouvez implémenter le code de votre action dans le fichier scripts techniques correspondant au bon support (mobile ou web).

Vous trouverez ci-dessous un exemple de code, lors de la création de nouvelle action, il est important de garder le prototype de la fonction ci-dessous :&#x20;

public static boolean NomAction(WebDriver selenium, Teststep teststep)<br>

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

Ajoutez le code de votre action dans le second try à la place du sendKeys de l'exemple ci-dessus. Une fois que votre action est ajoutée au script technique Kalios, il faut l’ajouter au fichier TextEngine qui fait office de relai. . Pour cela, vous devez utiliser cette syntaxe :

```java
    public static String[] clickbyid(String prop) throws IOException {
        boolean status = true;
        final String NatureAction = "id";
        final String NomAction = "clickbyid";
        String parcours_name = nom;

        String techlabel = SearchObject(NatureAction, prop);
        if (Objects.equals(techlabel, "")) {
            String[] result = new String[3];
            result[0] = NomAction;
            result[1] = "KO";
            result[2] = "Don't find Object";
            sa.fail("Don't find Object");
            return result;
        }
        //Initialiser Teststep
        Teststep t = new Teststep(NomAction, techlabel, parcours_name, null);
        Config.compteur_instance = 2;
        status = Scripts_techniques.Webobject_clickbyid(selfdriver, t);
        Config.compteur_instance = 1;
        //Si le clique a reussi
        if (status)
            Fonctions.SaveXpath(nom, techlabel, csvfilebuff);

        Config.compteur_params++;
        return Status(t);
    }
```


---

# Agent Instructions: 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-9-le-textengine-avec-kaliostest/integrer-vos-propres-actions-a-kaliostest.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.
