I need a code sample using marionette with Java for testing automation, I read a few things, but I still can not understand how it works.
I need a code sample using marionette with Java for testing automation, I read a few things, but I still can not understand how it works.
I have no knowledge about Marionette, however it is out of use according to the link link
The link itself states that it is preferable to use FirefoxDriver with marionette = true
(or false
)
The following commands are (read the property with System.getProperty()
and set using System.setProperty()
in Java code or by command line using the -DpropertyName=value
flag) used by FirefoxDriver:
------------------------------------------------------------------------------------------
| Propriedade | O que faz |
------------------------------------------------------------------------------------------
| webdriver.firefox.bin | A localização do binário/programa usado pra controlar |
| | o Firefox |
------------------------------------------------------------------------------------------
| webdriver.firefox.marionette | Valor deve ser Boolean, se true o standalone-server irá |
| | ignorar qualquer requisição a uma habilidade do |
| | "marionette" desejadae irá forçar o firefox a usar o |
| | GeckoDriver, se false usará Legacy Firefox Driver |
------------------------------------------------------------------------------------------
|webdriver.firefox.profile | O nome do "perfil" usado quando o firefox inicia. Por |
| | padrão ele cria um "perfil" anonimo |
------------------------------------------------------------------------------------------
| webdriver.log.file | Log de arquivo que recebe o log do javascript (console) |
------------------------------------------------------------------------------------------
| webdriver.firefox.logfile | Log de arquivo que recebe o stdout/stderr do Firefox |
------------------------------------------------------------------------------------------
In the wiki he cited an example with Firebug: link
First download firepug xpi using a Mozilla-based browser (like Firefox) and started it
File file = new File("firebug-1.8.1.xpi");
FirefoxProfile firefoxProfile = new FirefoxProfile();
firefoxProfile.addExtension(file);
//previne exibir a tela de inicio
firefoxProfile.setPreference("extensions.firebug.currentVersion", "1.8.1");
WebDriver driver = new FirefoxDriver(firefoxProfile);
The link link cites an example with DesiredCapabilities
:
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
WebDriver driver = new FirefoxDriver(capabilities);