Search code examples
node.jsseleniumselenium-webdriverfirefoxgeckodriver

NodeJS selenium-driver geckodriver normal Firefox


I am using geckodriver in selenium-driver for NodeJS. I wanted the Firefox launched by geckodriver to be the normal Firefox (extension, FF account, history, cookies, address bar, etc.). Is there any way to do this using geckodriver?

enter image description here enter image description here


Solution

  • you cannot disable the automation symbol in gekodriver.

    But you can still use firefox profile as :

    Create a profile first then choose that profile and login to the site . THis stores the cookies to that profile. now use that profile.

    enter image description here

    type about:profiles and click create profile , once created click launch browser with profile and login to that website in the new browser. Now session will be saved in that profile.

    Now you can use this profile in your code:

    you can use this firefox profile as:

    const {Builder} = require('selenium-webdriver');
    const firefox = require('selenium-webdriver/firefox');
    
    let options = new firefox.Options();
    let profile = 'path';
    options.setProfile(profile);
    
    
    let driver = new Builder()
            .forBrowser('firefox')
            .setFirefoxOptions(options)
            .build();