# Sample Project - Mobile

Similarly to web, a project should include 3 core files:&#x20;

**oxygen.conf.js**, which includes the project configuration, this file contains the tools for the project such as which modules to use, creating suites to run multiple scripts, reporting type, etc.

**oxygen.env.js**, which includes the versions, different configurations, usernames, connection strings etc.

**oxygen.po.js**, which includes all the page objects, locators, functions, etc.

<div align="left"><img src="/files/-MYjjE8aFGKo2de_GeAj" alt=""></div>

### Simple mobile test example from scratch

Let's start by creating a folder and inside it creating the **oxygen.env.js** and defining our app settings

```javascript
module.exports = {

    test_version_9: { 
        username: 'user',
        password: 'pass',
        con_string: 'Driver={SQL Server};Server=DESKTOP\\SQLEXPRESS;',
        
        capabilities: {
            "deviceName": "ad071702170f42d9a0",
            "platformVersion": "8.0.0",
            "platformName": "Android",
            "appPackage": "clalit.android",
            "appActivity": "clalit.android.MainActivity",
            "automationName": "UIAutomator2",
            "noReset": false
        }
    },

    prod_version_9: {
        username: 'user',
        password: 'pass',
        con_string: 'Driver={SQL Server};Server=DESKTOP\\SQLEXPRESS;',
        
        capabilities: {
            "deviceName": "ad071702170f42d9a0",
            "platformVersion": "9.0.0",
            "platformName": "Android",
            "appPackage": "clalit.android",
            "appActivity": "clalit.android.MainActivity",
            "automationName": "UIAutomator2",
            "noReset": false
        }
    },

}
```

Now let's create the **oxygen.po.js** file

```javascript
module.exports = {
    
    loginScreen: {
        usernameInput: 'id=app.android:id/user',
        passwordInput: 'id=app.android:id/pass',
        loginButton: 'id=app.android:id/login_button',
    },
    
    searchScreen: {
        searchInput: 'id=app.android:id/search_input',
        searchButton: 'id=app.android:id/search_button',
    },
    
    searchUser: (name) => {
        mob.type(po.searchScreen.searchInput, name)
        mob.click(po.searchScreen.searchButton)
    }
    
}
```

Finally let's create the **oxygen.conf.js** file

```javascript
module.exports = {
    
    suites: [{
        name: 'End to End tests',
        cases: [
            { path: './Scripts/01. ' },
            { path: './Scripts/02. ' },
            { path: './Scripts/03. ' },
        ]
    }],

    modules: ['mob', 'log', 'assert'],

    reporting: {
        reporters: ['html', 'json']
    },

}
```

And now let's create a folder with our test scripts

{% hint style="info" %}
Don't forget to choose an environment
{% endhint %}

![](/files/-MZXlmLNhC-cSfmSutsj)

```javascript
mob.transaction('01. Initialize')
mob.init(env.capabilities)

mob.transaction('02. Type username & password')
mob.type(po.loginScreen.usernameInput, env.username)
mob.type(po.loginScreen.passwordInput, env.password)

mob.transaction('03. Login')
mob.click(po.loginScreen.loginButton)

mob.transaction('04. Search User')
po.searchUser('Tony')

mob.transaction('05. Assert Results')
mob.assertText('android.view.View[2]/android.widget.UserText', 'Tony')
```


---

# 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://docs.oxygenhq.org/download-installation-start/start-working-with-oxygen/getting-started-mobile/sample-project-mobile.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.
