Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
seganfredo-vini opened this issue Jul 28, 2020 · 5 comments
Closed

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

seganfredo-vini opened this issue Jul 28, 2020 · 5 comments
Labels

Comments

@seganfredo-vini
Copy link

seganfredo-vini commented Jul 28, 2020

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
    },
  },
}
@pratikghedia
Copy link

Also facing the same issue. The setGeoLocation function is not available in this.browser.

this.browser.setGeoLocation is not a function at WebDriver.setGeoLocation (node_modules/codeceptjs/lib/helper/WebDriver.js:2482:25)

@pignarg
Copy link

pignarg commented Jun 28, 2022

Is this being worked on? I'm having the same issues with these geoLocation functions.

@DavertMik DavertMik added the bug label Feb 16, 2023
@autotest-web
Copy link

autotest-web commented Dec 29, 2023

Hello ,
I'm also facing the same issues with geoLocation functions.

await I.setGeolocation(latitude, longitude)
this.browser.setGeoLocation is not a function
WebDriver.setGeoLocation (node_modules\codeceptjs\lib\helper\WebDriver.js:2455:25)

using latest codeceptjs version =3.5.10

@autotest-web
Copy link

autotest-web commented Jan 2, 2024

@peterngtr
Can you please look into the issue mentioned above asap,
Added geolocation actions in 2.3.0v
https://codecept.io/changelog/#_2-3-0

@kobenguyent
Copy link
Collaborator

resolved by #4105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants