How can I use gauge/taiko with other browser?

1.7k Views Asked by At

I use gauge/taiko/javascript this month and want use browser in my pc. I try to use gauge run --env="firefox" specs/ but not work. Any sample?

3

There are 3 best solutions below

0
On

To start with did you create the environment? https://docs.gauge.org/latest/configuration.html#creating-new-environment

You should not have to use the quotes with a single environment like this

 gauge run --env ci specs

After that did you configure the project to use the new environment? What you are doing is loading variables so you must provide the project with the variables needed to interact with that environment. In addition to a browser, I also need the root address of the enrivonment and specifiy whether I am in the DEV(elopment), CERT(ification), or PROD(uction) environment.

browserToUse = chrome
rootNgsUrl = http://(urlAddress)
envInUse = dev

This is then used in the DriverFactory to initialize the Driver to the proper browser

ChromeOptions options = new ChromeOptions();
options.AddArgument("--ignore-certificate-errors-spki-list");
options.AddArgument("--ignore-ssl-errors");
Driver = new ChromeDriver(options);

I believe that there are examples that include an example of the DriverFactory that will initialize your browser driver and allow you to use that environment.

0
On

Open your default.properties and add a new line at the bottom:

TTAIKO_BROWSER_PATH = <path to your browser executable>

For the Chrome Browser on a windows system this would be:

TAIKO_BROWSER_PATH = C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe
0
On

Taiko is a Node.js library to automate the Chrome browser. Therefore Taiko only works with Chrome browser.

Example