Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 16 04:21
    NorseGaud opened #143
  • Jan 14 03:53
    phil-davis commented #2962
  • Jan 14 03:53
    phil-davis commented #2962
  • Jan 14 03:53
    phil-davis commented #2962
  • Jan 14 03:53
    phil-davis commented #2962
  • Jan 14 03:53
    phil-davis commented #2962
  • Jan 14 03:53
    phil-davis commented #2962
  • Jan 14 03:52
    phil-davis commented #2962
  • Jan 14 03:52
    phil-davis commented #2962
  • Jan 13 11:07
    gravityvi review_requested #2994
  • Jan 13 11:07
    gravityvi review_requested #2994
  • Jan 13 11:03
    harshit-bs assigned #2992
  • Jan 13 11:03
    harshit-bs assigned #2992
  • Jan 13 11:02
    harshit-bs labeled #2974
  • Jan 13 11:02
    harshit-bs labeled #2974
  • Jan 13 11:02
    harshit-bs labeled #2974
  • Jan 13 11:02
    harshit-bs labeled #2974
  • Jan 13 10:55
    vaibhavsingh97 opened #2997
  • Jan 13 10:55
    vaibhavsingh97 opened #2997
  • Jan 13 07:41
    vaibhavsingh97 review_requested #2993
Ravi Sawlani
@gravityvi
@johndegey try using capabilities like this:
const chrome = require('selenium-webdriver/chrome');
const capabilities = new chrome.Options();
capabilities.addExtention(<file-path>)

module.exports = {
  test_settings: {
    chrome: {
      capabilities,
      webdriver: {
        start_process: true,
        server_path: require('chromedriver').path,
        cli_args: [
          // --verbose
        ]
      }
    }
  }
};
@eliorcohen seems to me like a bug could raise an issue regarding this on github?
Elior Cohen
@eliorcohen
@gravityvi just found some old bug that may be related (i guess that waitForVisible using the assert functionality) - nightwatchjs/nightwatch#2535 , it's a year old and still open
3 replies
i't trying a simple solution wo wrap the command and handle the async result
function waitForElementVisible(selector, timeout = 1500) {
  return new Promise((resolve, reject) => {
    console.log(`elementIsVisible:${selector}`);
    b.waitForElementVisible(selector, timeout, (data) => {
      if (data.status === -1) reject(data.result.error);
      resolve();
    })
  });
}
this is something that seems to be built-in the engine, it's check for ES6 and Async in the _watFor and such and can throw this error instead of returning a valid result for status inspection
John Degey
@johndegey
@gravityvi Hi, nothing seems to work, (type => capabilities.addExtensions), I delete the config file and regenerate it again and try simple change : can't even start in headless mode or maximized... no options are reflected in the command line use . If I use the logged command line from chromedriver.log, add --load-extension=/my/path/to/ext/folder --start-maximized, everything works fine. Also, the autogenerated file use the entry "goo:chromeOptions" in chrome.desiredCapabilities and use "chromeOptions" in 'selenium.chrome'.desiredCapabilities, this is confusing...
I try to set chrome binary but it is always using the same version, the 'chromeOptions - binary' does not work
could be great to have a complete conf file with all options as an example
John Degey
@johndegey
I give a try to the last v1, it is even worst than the v2 alpha... can't even start a chrome browser, it always start geckodriver... but use chromedriver.log as log file.... strange to see Marionnette Info for chrome...
Andrei Rusu
@beatfactor
you seem to be having a hard time there
I'm pretty confident Nightwatch is able to start a chrome browser by now...
over all these years, you'd imagine that the team would have figured that one out by now

here's how I do it:

npm install chromedriver
nightwatch --env chrome

it never fails.

Andrei Rusu
@beatfactor
About the goog:chromeOptions, I know it sucks. I never know which one is it either. I think both of them work.
John Degey
@johndegey
Ok, stupid I am... I did not notice that the autogenerated file for v1 as the webdriver.server_path set to geckodriver ;(
for the default and that the config chrome.webdriver did not override this....
2 replies
John Degey
@johndegey
@beatfactor yes, that's why after that I start to verify my dev machine before returning to code ^^
It only 2 days I play with Nightwatch (v2 alpha), I did not notice the difference about the server_path :)
John Degey
@johndegey
@beatfactor YES.... as soon as I understand that only the config in the "default" entry was used and that none of the chrome/firefox config overrides the default...
making a default only with chrome settings works
I have read the manual and use the auto-generated file but I did not understand that only de "default" entry was usefull... my fault
I should have excepted that since for browserstack.chrome, it has a extends: 'browserstack'
John Degey
@johndegey
If you have an example for loading an extension with Firefox, I will be more than happy :)
22 replies
Victoria0214
@Victoria0214
Hi! Could you advice please how to use elementIdText in page object?
this.api.elementIdText -> Cannot read property 'elementIdText' of undefined
this.elementIdText -> this.elementIdText is not a function
  checkElementsTextIsEqual(selector, text) {
    this.api.elements(selector, function (elements) {
      elements.value.forEach(function (res) {
        this.elementIdText(res.ELEMENT, function (result) {
          this.assert.equal(result.value, text);///
8 replies
Victoria0214
@Victoria0214
this function is in fileExplorer page, and I call it in specs fileExplorer.checkElementsTextIsEqual("@itemType", "Folder");
Ravi Sawlani
@gravityvi
Nightwatch v2 is now available in Beta :tada: . You can try it out with: npm install nightwatch@next. You can find more details in the this blog post: https://nightwatchjs.org/blog/nightwatch-v2-beta-is-available.html
Leo Laskin
@llaskin
is there a way to get the webdriver "driver" or "browser" object out of the "client" object?
1 reply
Ravi Sawlani
@gravityvi
Hey @llaskin, what's the version of Nightwatch you are using?
Alex
@awulkan
Is the console window supposed to pop up during every test on version 2.0.0-beta.1?
8 replies
psyfreak-dev
@psyfreak-dev
How to customize nightwatchjs xml output ?. Is it possible to do that. Thanks :pray
Cleverson Sampaio
@clevsampaio
image.png
How do I force the error to be a true error for the cucumber, I don't want it to appear that in the end it was all right
I've already used try/catch, but it doesn't work
Cleverson Sampaio
@clevsampaio
This happens with the sendKeys command.
I've tried using "suppressNotFoundErrors" but it doesn't seem to work
dharls36
@dharls36

I'd like to load a page and perform some functions before the start of each of my tests.

Is this possible?

I've added this in my globals file, but it doesn't seem to work;

module.exports = {
    beforeEach: function (browser, done) {
        console.log('setting up the test...');
        browser.url('https://www.******.co.uk');
        browser.pause(10000);
        done();
    }
};

Am I doing something obviously wrong with this, as it doesn't seem to display the 'setting up the test' text or load the webpage before the test starts. Thanks.

dharls36
@dharls36

Ok, so I now need to run code in my command script that references an entry in my globals file.

So far, my code looks like this in my command file;

var cmsDataNewsLetterSettings = require('../../config/commands/solr_query/globalSettings/newsletterSignUp');
var cmsNewsletterSettingsPage;

module.exports = {
     before: function(done) {
        var solrPrdCmsClient = this.globals.solrPrdCmsClient;
        cmsDataNewsLetterSettings.newsletter_signup_prompt_settings(solrPrdCmsClient, function(err,cmsNewsletterSettings) {
            if(err) {
                console.log(err);
                done(err);
            } else {
                cmsNewsletterSettingsPage = cmsNewsletterSettings;
                done();
            }
        });
    var numberOfPagesBeforePromptDisplayed = cmsNewsletterSettingsPage.i_NewsletterSignupPageViewThreshold;
    console.log(numberOfPagesBeforePromptDisplayed);
    }
};

However, I'm getting the error message;

command: "TypeError: Cannot read property 'solrPrdCmsClient' of undefined

Am I right in thinking that this error is caused by the command script not recognising the globals reference, or is the error elsewhere? Thanks.

Freddie
@fredski02
I'm using my camera and microphone. I get a permissions pop up, is there a way i can hit accept or tell chrome to auto accept in a config?
Victoria0214
@Victoria0214
Hi all nightwatch users! Which reporter could you advice? I see some bugs related to screenshots in already used allure reporter https://www.npmjs.com/package/nightwatch-allure, and #This project is no longer being maintained
Do you have some examples of successful and useful reporter?
dharls36
@dharls36

Hi.

As part of a beforeEach hook, I have this in my globals.js file;

var launchUrl = 'https://www.parkers.co.uk/';

module.exports = {
    beforeEach: function (browser, done) {
        browser.testSetup(launchUrl);
        done();
    },

However, instead of the definitive https://www.parkers.co.uk for the launchUrl, I'd like to reference this in a similar way as my test cases, so that it can be used for each environment (dev, test, etc). For example, in my test cases this URL is defined in the form of browser.launch_url, which it gets from my nightwatch.conf.js config file;

test_settings: {
        default: {
              launch_url: 'https://www.parkers.co.uk/'
          },

Is it possible to reference this nightwatch.conf.js entry within the globals.js file?

Any help would be greatly appreciated.

Rezaul Hassan
@RezhaBlue
Hi all, my team and I are having issues running firefox. It launches the browser but refuses to acknowledge any elements. I've confirmed the selector (both css and xpath variant) is correct and provided more than ample time for page load, dom ready, etc. with multiple polling. No matter what it times out searching for an element that is obviously there. It feels like its not looking at the webpage after browser launch. There are no iframes on the page. Has anyone else experienced this? I am using nightwatch 1.7.11 and 1.7.13 variants
The firefox version number is 95
We've tried on different people's computers (mac m1, ubuntu 20, windows 10, docker:node latest) and both dockerized/containerized and without, and in our local, testing, staging, and prod environments. None of these factors seem to alter the behavior
Rezaul Hassan
@RezhaBlue
This is the closest relevant nightwatch issue I could find relevant to our situation but couldnt find a suitable resolution. nightwatchjs/nightwatch#2017
1 reply
I forgot to mention we are also using selenoid hence the relevance to a selenium hub issue