There was an error while loading. Please reload this page.
We reccommend use direct mapping on DOM document
<html> <body> <div class="header-wrapper container"> <form id="auth"> <input name="login"> <input name="password"> <button>Submit</button> <form> </div> </body> </html>
from pagium import Page, PageElement, WebElement, By, controls, hooks class MyPage(Page): __path__ = '/' class Header(WebElement): class AuthForm(WebElement): username = PageElement(controls.Input, by=By.NAME, value='username') password = PageElement(controls.Input, by=By.NAME, value='password') submit = PageElement(by=By.TAG_NAME, value='button', hook=hooks.ClickActionHook) auth_form = PageElement(AuthForm, by=By.TAG_NAME, value='form') header = PageElement(Header, by=By.CSS_SELECTOR, value='[class*="header-wrapper"]') with MyPage(wd, 'http://project') as page: page.header.auth_form.username.fill('username') page.header.auth_form.password.fill('password') page.header.auth_form.submit()