Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

AttributeError: 'CustomCommandExecutor' object has no attribute 'step_settings' #143

Closed
Rantzur1992 opened this issue Mar 15, 2021 · 0 comments · Fixed by #146
Closed

AttributeError: 'CustomCommandExecutor' object has no attribute 'step_settings' #143

Rantzur1992 opened this issue Mar 15, 2021 · 0 comments · Fixed by #146

Comments

@Rantzur1992
Copy link
Contributor

Rantzur1992 commented Mar 15, 2021

Using this test:

from addons.web_extensions import WebExtensions
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.sdk.drivers import webdriver
from src.testproject.sdk.drivers.actions import Actions
import pytest



@pytest.fixture()
def driver():
    driver = webdriver.Chrome(token="",
                              project_name="Test",
                              job_name="Test")
    step_settings = StepSettings(timeout=2000)
    with DriverStepSettings(driver, step_settings):
        yield driver
    driver.quit()


@report_assertion_errors
def test_main(driver):
    # Test Parameters
    ApplicationURL = "https://mobii.ai"  # Auto generated application URL parameter

    # 1. Navigate to '{ApplicationURL}'
    # Navigates the specified URL (Auto-generated)
    driver.get(f'{ApplicationURL}')

    # 2. Click 'IMG4'
    # step_settings = StepSettings(always_pass=True)
    # with DriverStepSettings(driver, step_settings):
    #     img4 = driver.find_element(By.XPATH,
    #                                "//swiper/div/button/img")
    #     img4.click()

    # 3. Set window size to ('760','1020')
    driver.addons().execute(
        WebExtensions.setwindowsize(
            width="760",
            height="1020"))

    # 4. Pause for '1000'ms
    driver.pause(milliseconds=1000)

    # 5. Click 'IMG31'
    img31 = driver.find_element(By.XPATH,
                                "//div[1]/div/div[5]/a//img")
    img31.click()

    # 6. Is 'IMG32' visible?
    img32 = driver.find_element(By.XPATH,
                                "//div/div/a/img")
    assert img32.is_displayed()

    # 7. Click 'IMG9'
    img9 = driver.find_element(By.XPATH,
                               "//a[5]/img[1]")
    img9.click()

Results in:

FAILED test_1_244_demo.py::test_main - AttributeError: 'CustomCommandExecutor' object has no attribute 'step_settings'

At step:

    # 4. Pause for '1000'ms
    driver.pause(milliseconds=1000)

Using SDK 0.65.2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant