All Projects → njasm → Marionette_client

njasm / Marionette_client

Licence: mit
Mozilla's Gecko Marionette client in golang

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Marionette client

Marionette
Selenium alternative for Crystal. Browser manipulation without the Java overhead.
Stars: ✭ 119 (+466.67%)
Mutual labels:  selenium, webdriver, selenium-webdriver, firefox
Selenium Python Helium
Selenium-python but lighter: Helium is the best Python library for web automation.
Stars: ✭ 2,732 (+12909.52%)
Mutual labels:  selenium, webdriver, firefox
Php Webdriver
PHP client for Selenium/WebDriver protocol. Previously facebook/php-webdriver
Stars: ✭ 4,477 (+21219.05%)
Mutual labels:  selenium, webdriver, selenium-webdriver
Atata
C#/.NET test automation framework for web
Stars: ✭ 362 (+1623.81%)
Mutual labels:  selenium, webdriver, selenium-webdriver
Panther
A browser testing and web crawling library for PHP and Symfony
Stars: ✭ 2,480 (+11709.52%)
Mutual labels:  selenium, webdriver, selenium-webdriver
Steward
PHP libraries that makes Selenium WebDriver + PHPUnit functional testing easy and robust
Stars: ✭ 215 (+923.81%)
Mutual labels:  selenium, webdriver, selenium-webdriver
google-meet-bot
Bot for scheduling and entering google meet sessions automatically
Stars: ✭ 33 (+57.14%)
Mutual labels:  webdriver, selenium, selenium-webdriver
Java.webdriver
Browser test automation using Selenium WebDriver in Java
Stars: ✭ 135 (+542.86%)
Mutual labels:  selenium, webdriver, selenium-webdriver
PWAF
Python Webdriver Automation Framework
Stars: ✭ 37 (+76.19%)
Mutual labels:  webdriver, selenium, selenium-webdriver
page-modeller
⚙️ Browser DevTools extension for modelling web pages for automation.
Stars: ✭ 66 (+214.29%)
Mutual labels:  webdriver, selenium, selenium-webdriver
atata-kendoui
A set of Atata components for Kendo UI
Stars: ✭ 17 (-19.05%)
Mutual labels:  webdriver, selenium, selenium-webdriver
Selenium Maven Template
A maven template for Selenium that will let you check out and go.
Stars: ✭ 403 (+1819.05%)
Mutual labels:  selenium, webdriver, selenium-webdriver
Thirtyfour
Selenium WebDriver client for Rust, for automated testing of websites
Stars: ✭ 191 (+809.52%)
Mutual labels:  selenium, webdriver, selenium-webdriver
Golem
A complete test automation tool
Stars: ✭ 441 (+2000%)
Mutual labels:  selenium, webdriver, selenium-webdriver
Webium
Webium is a Page Object pattern implementation library for Python (http://martinfowler.com/bliki/PageObject.html). It allows you to extend WebElement class to your custom controls like Link, Button and group them as pages.
Stars: ✭ 144 (+585.71%)
Mutual labels:  selenium, webdriver, selenium-webdriver
Cdp4j
cdp4j - Chrome DevTools Protocol for Java
Stars: ✭ 232 (+1004.76%)
Mutual labels:  selenium, webdriver, selenium-webdriver
Csharp.webdriver
Browser test automation using Selenium WebDriver in C#
Stars: ✭ 115 (+447.62%)
Mutual labels:  selenium, webdriver, selenium-webdriver
E2e Experiment
A demo project with Spring Boot / Angular application and e2e tests
Stars: ✭ 9 (-57.14%)
Mutual labels:  selenium, webdriver, selenium-webdriver
spydriver
🕵️ Lightweight utility to intercept WebDriver and WebElement method calls.
Stars: ✭ 24 (+14.29%)
Mutual labels:  webdriver, selenium, selenium-webdriver
TestLeafSeleniumTraining
This is public repository for Selenium Learners at TestLeaf
Stars: ✭ 80 (+280.95%)
Mutual labels:  firefox, webdriver, selenium

GoDoc Build Status Coverage Status Go Report Card License

marionette_client

Mozilla's Gecko Marionette client in golang

What is Marionette

"Marionette is an automation driver for Mozilla's Gecko engine. It can remotely control either the UI or the internal JavaScript of a Gecko platform, such as Firefox. It can control both the chrome (i.e. menus and functions) or the content (the webpage loaded inside the browsing context), giving a high level of control and ability to replicate user actions. In addition to performing actions on the browser, Marionette can also read the properties and attributes of the DOM.

If this sounds similar to Selenium/WebDriver then you're correct! Marionette shares much of the same ethos and API as Selenium/WebDriver, with additional commands to interact with Gecko's chrome interface. Its goal is to replicate what Selenium does for web content: to enable the tester to have the ability to send commands to remotely control a user agent."

Resources

https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette

https://w3c.github.io/webdriver/webdriver-spec.html

Examples

Incomplete list. Check the tests for more examples.

Instantiate the client

	client := NewClient()
	client.Connect("", 0) // this are the default marionette values for hostname, and port 
	client.NewSession("", nil) // let marionette generate the Session ID with it's default Capabilities
	

Navigate to page

	client.Navigate("http://www.google.com/")

Change Contexts

    client.SetContext(Context(CHROME))
    //or
	client.SetContext(Context(CONTENT))
	

Find Element

	element, err := client.FindElement(By(ID), "html-element-id-attribute")
	if err != nil {
		// handle your errors
	}

    // else
	println(element.Id())
	println(element.Enabled())
	println(element.Selected())
	println(element.Displayed())
	println(element.TagName())
	println(element.Text())
	println(element.Attribute("id"))
	println(element.CssValue("text-decoration"))
	
	// width, height, x and y
	rect, err := element.Rect()
	if err != nil {
        // handle your errors
	}

	fmt.Printf("%#v", rect)
	
	// size
	w, h, err := element.Size()
	if err != nil {
		// handle your errors
	}
	
    fmt.Printf("width: %f, height: %f", w, h)
    
	//location
	x, y, err := element.Location()
	if err != nil {
	    // handle your errors
	}
	
	fmt.Printf("x: %v, y: %v", x, y)

Find Elements

	collection, err := element.FindElements(By(TAG_NAME), "li")
	if err != nil {
		// handle your errors
	}

    // else
    for var e := range collection {
    	println(e.Id())
    	println(e.Enabled())
    	println(e.Selected())
    	println(e.Displayed())
    	println(e.TagName())
    	println(e.Text())
    	println(e.Attribute("id"))
    	println(e.CssValue("text-decoration"))
    	e.Click()
    }

Execute JS Script

	script := "function mySum(a, b) { return a + b; }; return mySum(arguments[0], arguments[1]);"
	args := []int{1, 3} // arguments to be passed to the function
	timeout := 1000     // milliseconds
	sandbox := false    // new Sandbox
	r, err := client.ExecuteScript(script, args, timeout, sandbox)
	if err == nil {
	    println(r.Value)    // 4 
	}

Wait(), Until() Expected condition is true.

	client.Navigate("http://www.w3schools.com/ajax/tryit.asp?filename=tryajax_get")
	
	timeout := time.Duration(10) * time.Second
	condition := ElementIsPresent(By(ID), "stackH")
	ok, webElement, err := Wait(client).For(timeout).Until(condition)

	if !ok {
		log.Printf("%#v", err)
		// do your error stuff
		return
	}

    // cool, we've the element, let's click on it!
	webElement.Click()
	
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].