Skip to content

login

Login(browser, container=Selector(select='form.loginForm'))

Bases: BaseComponent

Component: Login To login into the Splunk instance

Parameters:

Name Type Description Default
browser

The selenium webdriver

required
container

Container in which the table is located. Of type dictionary: {“by”:…, “select”:…}

Selector(select='form.loginForm')
Source code in pytest_splunk_addon_ui_smartx/components/login.py
30
31
32
33
34
35
36
37
38
39
40
41
def __init__(self, browser, container=Selector(select="form.loginForm")):
    """
    :param browser: The selenium webdriver
    :param container: Container in which the table is located. Of type dictionary: {"by":..., "select":...}
    """
    super().__init__(browser, container)

    self.elements = {
        "username": Selector(by=By.ID, select="username"),
        "password": Selector(by=By.ID, select="password"),
        "homepage": Selector(select='a[data-action="home"]'),
    }

login(username, password)

Login into the Splunk instance :param username: Str the username for the splunk instance we want to access :param password: Str the password for the splunk instance we want to access

Source code in pytest_splunk_addon_ui_smartx/components/login.py
43
44
45
46
47
48
49
50
51
52
def login(self, username, password):
    """
    Login into the Splunk instance
        :param username: Str the username for the splunk instance we want to access
        :param password: Str the password for the splunk instance we want to access
    """
    self.username.send_keys(username)
    self.password.send_keys(password)
    self.password.send_keys("\ue007")
    self.wait_for("homepage", "Could not log in to the Splunk instance.")