Skip to content

I.grab/setGeoLocation is not working with WebDriver #2505

Closed
@seganfredo-vini

Description

@seganfredo-vini

What are you trying to achieve?

I'm trying to grab/set the geolocation in order to test different scenarios for different countries.

Before(async () => {
    I.amOnPage("/");
    let geo = await I.grabGeoLocation()
    console.log(geo)
})

Also tried grabbing the geo location before accessing the page:

Before(async () => {
    let geo = await I.grabGeoLocation()
    I.amOnPage("/");
    console.log(geo)
})

I tried to use I.setGeoLocation too, the result is the same.

In case grab/setGeoLocation methods are not available anymore, please remove them from the documentation

What do you get instead?

       "before each" hook: Before for "My test @myTag":
     this.browser.getGeoLocation is not a function

Provide test source code if related

Before(async () => {
    I.amOnPage("/");
    let geo = await I.grabGeoLocation()
    console.log(geo)
})

Details

  • CodeceptJS version: 2.6.3
  • NodeJS Version: 12.10.0
  • Operating System: Windows 10
  • puppeteer || webdriverio || protractor || testcafe version (if related) - WebDriver + Selenoid
  • Configuration file:
require('dotenv').config()
const { setHeadlessWhen } = require('@codeceptjs/configure');

setHeadlessWhen(process.env.HEADLESS);

exports.config = {
  tests: './tests/**/**/*_test.js',
  output: './output',
  helpers: {
    WebDriver: {
      url: process.env.BASE_URL,
      browser: process.env.BROWSER || 'chrome',
      restart: false,
      host: '127.0.0.1',
      port: 4444,
      protocol: 'http',
      windowSize: '1600x1080',
      outputDir: './output',
    },
    ChaiWrapper: {
      require: "codeceptjs-chai"
    },
    CustomHelper: {
      require: './helpers/utils/customHelper.js'
    }
  },
  include: {
    myPage: "path/to/page"
  },
  bootstrap: null,
  mocha: {},
  name: 'automation',
  plugins: {
    selenoid: {
      enabled: true,
      deletePassed: false,
      autoCreate: false,
      autoStart: false,
      sessionTimeout: '20m',
      enableVideo: false,
      enableLog: true,
      // enableVNC: true
    },
    retryFailedStep: {
      enabled: true
    },
    screenshotOnFail: {
      enabled: true
    },
  },
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions