Documentation ¶
Overview ¶
Package venomWeb provide class to interact easily with web driver
Index ¶
- func DefineLogLevel(logLevel string)
- type Element
- func (elt Element) Check() error
- func (elt Element) Clear() error
- func (elt Element) Click() error
- func (elt Element) DoubleClick() error
- func (elt Element) FindElement(selector string, selectorStrategy string) (Element, error)
- func (elt Element) FindElements(selector string, selectorStrategy string) ([]Element, error)
- func (elt Element) GetComputedLabel() (string, error)
- func (elt Element) GetComputedRole() (string, error)
- func (elt Element) GetElementCSSValue(propertyName string) (string, error)
- func (elt Element) GetElementProperty(propertyName string) (string, error)
- func (elt Element) GetElementRect() (common.Rect, error)
- func (elt Element) GetElementShadowRoot() (Element, error)
- func (elt Element) GetElementTagName() (string, error)
- func (elt Element) GetElementText() (string, error)
- func (elt Element) IsElementEnabled() (bool, error)
- func (elt Element) IsElementSelected() (bool, error)
- func (elt Element) Select(text string) (Element, error)
- func (elt Element) SendKeys(text string) error
- func (elt Element) TakeScreenshot(fileName string) error
- func (elt Element) Uncheck() error
- func (elt Element) UploadFile(file string) error
- type Session
- func (s Session) AcceptAlert() error
- func (s Session) AddCookie(cookie common.Cookie) error
- func (s Session) Back() error
- func (s Session) CloseWindow() error
- func (s Session) DeleteAllCookies() error
- func (s Session) DeleteCookie(cookieName string) error
- func (s Session) DeleteSession() error
- func (s Session) DismissAlert() error
- func (s Session) ExecuteAsyncScript(script string, args []string) error
- func (s Session) ExecuteScript(script string, args []string) error
- func (s Session) FindElement(selector string, locatorStrategy string) (Element, error)
- func (s Session) FindElements(selector string, locatorStrategy string) ([]Element, error)
- func (s Session) Forward() error
- func (s Session) Fullscreen() error
- func (s Session) GetActiveElement() (Element, error)
- func (s Session) GetAlertText() (string, error)
- func (s Session) GetAllCookies() ([]string, error)
- func (s Session) GetNamedCookie(cookieName string) (string, error)
- func (s Session) GetPageSource() (string, error)
- func (s Session) GetSize() (common.Rect, error)
- func (s Session) GetTimeouts() (common.Timeouts, error)
- func (s Session) GetTitle() (string, error)
- func (s Session) GetURL() (string, error)
- func (s Session) GetWindow() (Window, error)
- func (s Session) GetWindows() ([]Window, error)
- func (s Session) Maximize() error
- func (s Session) Minimize() error
- func (s Session) Navigate(url string) error
- func (s Session) NewWindow(windowType string) (Window, error)
- func (s Session) NextWindow() error
- func (s Session) Refresh() error
- func (s Session) Reset() error
- func (s Session) SendAlertText(alertText string) error
- func (s Session) SetTimeouts(timeouts common.Timeouts) error
- func (s Session) Size(width int, height int) error
- func (s Session) String() string
- func (s Session) SwitchToFrame(element Element) error
- func (s Session) SwitchToIndexFrame(index int) error
- func (s Session) SwitchToParentFrame() error
- func (s Session) SyncElement(selector string, locatorStrategy string, timeout int64) error
- func (s Session) SyncElementAbsence(selector string, locatorStrategy string, timeout int64) error
- func (s Session) SyncElementCSSValue(selector string, locatorStrategy string, timeout int64, CSSPropertyName string, ...) error
- func (s Session) SyncElementProperyValue(selector string, locatorStrategy string, timeout int64, CSSPropertyName string, ...) error
- func (s Session) SyncElementText(selector string, locatorStrategy string, timeout int64, expectedText string) error
- func (s Session) TakeScreenshot(fileName string) error
- type Shadow
- type WebDriver
- func BraveDriver(browserBinary string, driverBinary string, args []string, ...) WebDriver
- func ChromeDriver(browserBinary string, driverBinary string, args []string, ...) WebDriver
- func EdgeChroniumDriver(browserBinary string, driverBinary string, args []string, ...) WebDriver
- func GeckoDriver(browserBinary string, driverBinary string, args []string, ...) WebDriver
- func NewWebDriver(webDriver *WebDriver) WebDriver
- func OperaDriver(browserBinary string, driverBinary string, args []string, ...) WebDriver
- type Window
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefineLogLevel ¶
func DefineLogLevel(logLevel string)
Types ¶
type Element ¶
type Element struct {
// contains filtered or unexported fields
}
func (Element) Check ¶
Check method allow to check a checkbox web element Return nil if operation proceed with success, return an error else
func (Element) Clear ¶
Clear method allow to clear text value of a web element Return nil if operation proceed with success, return an error else
func (Element) Click ¶
Click method allow to click on a web element Return nil if operation proceed with success, return an error else "invalid session id" error occured when session not found "invalid element id" error occured when element not found
func (Element) DoubleClick ¶
Double click method allow to proceed a double click action on a web element Return nil if operation proceed with success, return an error else
func (Element) FindElement ¶
FindElement method allow to search a web element from a parent element Return the element if operation proceed with success, return an error else
func (Element) FindElements ¶
FindElements method allow to search web elements from a parent element Return element list if operation proceed with success, return an error else
func (Element) GetComputedLabel ¶
GetComputedLabel method allow to get computed label of the current element Return computed label if operation proceed with success, return an error else
func (Element) GetComputedRole ¶
GetComputedRole method allow to get computed role of the current element Return computed role if operation proceed with success, return an error else
func (Element) GetElementCSSValue ¶
GetElementCSSValue method allow to get CSS property of the current element Return property value if operation proceed with success, return an error else
func (Element) GetElementProperty ¶
GetElementProperty method allow to get HTML property of the current element Return property value if operation proceed with success, return an error else
func (Element) GetElementRect ¶
GetElementRect method allow to get element position Return element position if operation proceed with success, return an error else
func (Element) GetElementShadowRoot ¶
GetElementShadowRoot method allow to identify root shadow element from a parent element Return element if operation proceed with success, return an error else
func (Element) GetElementTagName ¶
GetElementTagName method allow to get tag name of the current element Return tag name if operation proceed with success, return an error else
func (Element) GetElementText ¶
GetElementText method allow to get text of the current element Return text if operation proceed with success, return an error else
func (Element) IsElementEnabled ¶
IsElementEnabled method allow to identify if element enabled or not Return if element is enabled if operation proceed with success, return an error else
func (Element) IsElementSelected ¶
IsElementSelected method allow to identify if the current element is selected or not Return a boolean to indicate if element selected, return an error else
func (Element) Select ¶
Select method allow to select an option of a list of values element (<select>) Return otpion element if operation proceed with success, return an error else
func (Element) SendKeys ¶
SendKeys method allow to send text value on web element Return nil if operation proceed with success, return an error else
func (Element) TakeScreenshot ¶
TakeScreenshot method allow to save the screenshot of the current element Return nil if operation proceed with success, return an error else
func (Element) Uncheck ¶
Uncheck method allow to uncheck a checkbox web element Return nil if operation proceed with success, return an error else
func (Element) UploadFile ¶
UploadFile method allow to upload file on an upload web element Return nil if operation proceed with success, return an error else
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (Session) AcceptAlert ¶
func (Session) CloseWindow ¶
func (Session) DeleteAllCookies ¶
func (Session) DeleteCookie ¶
func (Session) DeleteSession ¶
Delete session method allow to destroy web driver session Return nil if operation proceed with success, return an error else
func (Session) DismissAlert ¶
func (Session) ExecuteAsyncScript ¶
func (Session) FindElement ¶
func (Session) FindElements ¶
func (Session) Fullscreen ¶
func (Session) GetActiveElement ¶
func (Session) GetAlertText ¶
func (Session) GetAllCookies ¶
func (Session) GetPageSource ¶
func (Session) GetTimeouts ¶
GetTimeouts method allow to get timeout values Return timeout object if operation succeed, return an error else
func (Session) GetURL ¶
GetURL method allow to get the current web driver URL Return URL if operation succeed, return an error else
func (Session) GetWindows ¶
func (Session) Navigate ¶
Navigate method allow to change the current web driver url Return nil if operation succeed, return an error else
func (Session) NextWindow ¶
func (Session) Reset ¶
Reset current session allow to reset web driver state Return nil if operation proceed with sucess, return an error else
func (Session) SendAlertText ¶
func (Session) SetTimeouts ¶
SetTimeouts method allow to set timeout value Return nil if operation succeed, return an error else
func (Session) SwitchToFrame ¶
func (Session) SwitchToIndexFrame ¶
func (Session) SwitchToParentFrame ¶
func (Session) SyncElement ¶
SyncElement allow to wait the web element creation Return nil if operation succeed, return an error else
func (Session) SyncElementAbsence ¶
SyncElementAbsence allow to wait the web element deletion Return nil if operation succeed, return an error else
func (Session) SyncElementCSSValue ¶
func (s Session) SyncElementCSSValue(selector string, locatorStrategy string, timeout int64, CSSPropertyName string, expectedValue string) error
SyncElementCSSValue allow to wait a specific CSS value of an element Return nil if operation succeed, return an error else
func (Session) SyncElementProperyValue ¶
func (s Session) SyncElementProperyValue(selector string, locatorStrategy string, timeout int64, CSSPropertyName string, expectedValue string) error
SyncElementPropertyValue allow to wait a specific property value of an element Return nil if operation succeed, return an error else
func (Session) SyncElementText ¶
func (s Session) SyncElementText(selector string, locatorStrategy string, timeout int64, expectedText string) error
SyncElementText allow to wait text value of an element Return nil if operation succeed, return an error else WebSite to test this feature: https://www.w3schools.com/w3css/w3css_progressbar.asp
func (Session) TakeScreenshot ¶
type Shadow ¶
type Shadow struct {
// contains filtered or unexported fields
}
func (Shadow) FindElementFromShadowId ¶
type WebDriver ¶
type WebDriver struct { Headless bool Proxy string Detach bool LogLevel string Timeout time.Duration // contains filtered or unexported fields }
func BraveDriver ¶
func ChromeDriver ¶
func EdgeChroniumDriver ¶
func GeckoDriver ¶
func NewWebDriver ¶
func OperaDriver ¶
func (*WebDriver) NewSession ¶
Instanciate a new session to browser server