How can I run Python using SDK

Sorry for the noob question, Im still trying to learn automation

I have this code to run a simple login validation:

from selenium.webdriver.common.by import By
from src.testproject.classes import DriverStepSettings, StepSettings
from src.testproject.decorator import report_assertion_errors
from src.testproject.enums import SleepTimingType
from src.testproject.sdk.drivers import webdriver
import pytest


@pytest.fixture()
def driver():
    capabilities = {
        "platformName": "Android",
        "udid": "emulator-5554",
        "appPackage": "com.bbemman.app.test",
        "appActivity": "com.bbapp.MainActivity",
    }
    driver = webdriver.Remote(token="7v5Ap4q3NAFsFI1mz8fgIl1w6tqi8KddiJwtTrdPAPU",
                              project_name="My first Project",
                              job_name="Login",
                              desired_capabilities=capabilities)
    step_settings = StepSettings(timeout=15000,
                                 sleep_time=500,
                                 sleep_timing_type=SleepTimingType.Before)
    with DriverStepSettings(driver, step_settings):
        yield driver
    driver.quit()


@report_assertion_errors
def test_main(driver):

    # 1. Reset App
    # Clear application data and restart (Auto-generated)
    driver.reset()

    # 2. Click 'login_username_input'
    login_username_input = driver.find_element(By.XPATH, "//android.widget.EditText[@content-desc = 'login_username_input']")
    login_username_input.click()

    # 3. Type 'admin' in 'login_username_input'
    login_username_input = driver.find_element(By.XPATH, "//android.widget.EditText[@content-desc = 'login_username_input']")
    login_username_input.send_keys("admin")

    # 4. Click 'login_password_input'
    login_password_input = driver.find_element(By.XPATH, "//android.widget.EditText[@content-desc = 'login_password_input']")
    login_password_input.click()

    # 5. Type '123456!' in 'login_password_input'
    login_password_input = driver.find_element(By.XPATH, "//android.widget.EditText[@content-desc = 'login_password_input']")
    login_password_input.send_keys("123456!")

    # 6. Make a Swipe gesture from ('831','689') to ('806','1129')
    driver.swipe(start_x=831, start_y=689, end_x=806, end_y=1129, duration=300)

    # 7. Click 'login_button'
    login_button = driver.find_element(By.XPATH, "//android.view.ViewGroup[@content-desc = 'login_button']")
    login_button.click()

    # Check
    paval = driver.find_element(By.XPATH, "//android.view.ViewGroup/android.widget.TextView[@text = 'Home']")

    assert paval.is_displayed("Home")


This won’t run but this is not showing an error either.

Any ideas?

Hi @emmanuel.

Please share the code with support@testproject.io and we will check what might be causing it.

@Ricardo.Caster thanks for the quick reply.

I will send this

@emmanuel

Thanks :slight_smile:

Hi,
I have the same problem. A solution has been found?