Git Product home page Git Product logo

Comments (7)

chmanie avatar chmanie commented on May 24, 2024

Which versions of webriver.io / webdriverajax are you using? The newest versions don't support chaining of commands like that.

Please also refer to the readme: https://github.com/chmanie/webdriverajax/blob/master/README.md

from wdio-intercept-service.

TimeTravelersHackedMe avatar TimeTravelersHackedMe commented on May 24, 2024

I'm using "webdriverio": "^4.8.0"

What version should I use instead of that? I'll just have to add "client" before each of the lines to prevent chaining?

from wdio-intercept-service.

TimeTravelersHackedMe avatar TimeTravelersHackedMe commented on May 24, 2024

Here's your NPM info:

"webdriverajax": "^2.0.0",
"webdriverio": "^4.8.0"

from wdio-intercept-service.

chmanie avatar chmanie commented on May 24, 2024

I'll just have to add "client" before each of the lines to prevent chaining?

Basically yes, webdriver.io v4 and hence webdriverajax v2 don't support this kind of chaining.

from wdio-intercept-service.

TimeTravelersHackedMe avatar TimeTravelersHackedMe commented on May 24, 2024

Okay.. I tried it without chaining with no success. Here's my code:

var webdriverio = require('webdriverio');
var webdriverajax = require('webdriverajax');
var request = require('request');
var request = require('request').defaults({ jar: true });
var options = {
	desiredCapabilities: {
		browserName: 'chrome',
		logLevel: 'verbose'
	},
	plugins: {
		webdriverajax: {}
	}
};

var browser = webdriverio.remote(options);

browser.url('http://xxx.com/latest')
browser.setupInterceptor()
browser.click('#button')
browser.pause(1000);

var request = browser.getRequest(0);
assert.equal(request.method, 'GET');
assert.equal(request.response.headers['content-length'], '42');

When I run node app.js I get the following error:

browser.setupInterceptor is not a function

from wdio-intercept-service.

chmanie avatar chmanie commented on May 24, 2024

As far as I'm concerned, the "old" method of using this plugin programatically didn't really work for me in v2. In general, the support for that in v4 seems kind of shaky. That's why I removed it from the readme.

Did you try running it via wdio?

from wdio-intercept-service.

chmanie avatar chmanie commented on May 24, 2024

I'm closing this due to inactivity. Hope you solved the issue.

from wdio-intercept-service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.