Documentation ¶
Index ¶
- type ClientConfig
- type Selenium
- func (s *Selenium) CleanUp()
- func (s *Selenium) CloseSelenium()
- func (s *Selenium) Fatal(msg string, err error)
- func (s *Selenium) GetElement(elementTag, locator string) (selenium.WebElement, error)
- func (s *Selenium) GetElements(elementTag, locator string) ([]selenium.WebElement, error)
- func (s *Selenium) InitChromeWebDriver()
- func (s *Selenium) InitFirefoxWebDriver()
- func (s *Selenium) InitializeSelenium(clientConfig *ClientConfig)
- func (s *Selenium) IsElementPresent(by, value string) bool
- func (s *Selenium) SigTermCleaning()
- func (s *Selenium) WaitForElement(elementTag, locator string, delay int) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientConfig ¶
type ClientConfig struct { // LogLevel set loglevel threshold // If undefined or wrong set it to INFO level LogLevel logrus.Level // ForceDependenciesDl force re-download of all dependencies ForceDependenciesDl bool // Debug set selenium debug mode and display its logging to stderr Debug bool //DevTools launch Electron gui with devtools openned DevTools bool // IgnoreDependencies disable dependencies manager on startup IgnoreDependencies bool // Headless execute Selenium webdriver in headless mode Headless bool // Port : communication port Port uint16 }
ClientConfig struct centralize all client configuration and flags. Inizialized at program startup, not safe to modify this after.
func CreateClientConfig ¶
func CreateClientConfig() *ClientConfig
CreateClientConfig create default ClientConfig instance and return a pointer on it
type Selenium ¶
type Selenium struct { Instance *selenium.Service Config *ClientConfig Opts []selenium.ServiceOption Proxy proxy.Proxy `yaml:"proxy"` WebDriver selenium.WebDriver SigTermRoutineExit chan bool }
Selenium instance and opts
func (*Selenium) CleanUp ¶
func (s *Selenium) CleanUp()
CleanUp clean app ressources including Selenium stuff and proxy-login-automator instance (if exist)
func (*Selenium) CloseSelenium ¶
func (s *Selenium) CloseSelenium()
CloseSelenium close webdriver and selenium instances
func (*Selenium) GetElement ¶
func (s *Selenium) GetElement(elementTag, locator string) (selenium.WebElement, error)
GetElement wait for element and then return when it's available
func (*Selenium) GetElements ¶
func (s *Selenium) GetElements(elementTag, locator string) ([]selenium.WebElement, error)
GetElements wait for elements and then return when they're available
func (*Selenium) InitChromeWebDriver ¶
func (s *Selenium) InitChromeWebDriver()
InitChromeWebDriver init and launch web driver with Chrome
func (*Selenium) InitFirefoxWebDriver ¶
func (s *Selenium) InitFirefoxWebDriver()
InitFirefoxWebDriver init and launch web driver with Firefox
func (*Selenium) InitializeSelenium ¶
func (s *Selenium) InitializeSelenium(clientConfig *ClientConfig)
InitializeSelenium start a Selenium WebDriver server instance (if one is not already running).
func (*Selenium) IsElementPresent ¶
IsElementPresent check if an element is present on the current webpage
func (*Selenium) SigTermCleaning ¶
func (s *Selenium) SigTermCleaning()
SigTermCleaning launch a gouroutine to handle SigTerm signal and trigger Selenium and Webdriver closing if it raised