S
S
shqn2015-04-17 21:17:15
C++ / C#
shqn, 2015-04-17 21:17:15

Is PhantomJS 2.0+Selenium too slow?

Hey!
In search of an alternative for ChromeDriver, I began to look towards PhantomJS + GhostDriver. The project I'm working on has grown a lot, the number of tests has increased to 4000, and the question arose of speeding up and improving stability. Having run the whole pack on PhantomJS 1.9.8, I saw a lot of failed tests, many of which PhantomJS 2.0.0 nevertheless coped with, but the speed of its work was unpleasantly surprising. After measurements, it turned out that it is inferior to the previous version in terms of speed by about 1.5-2 times. I found this article https://plus.google.com/+Ivan%C4%8Cent%C3%A9%C5%A1... , but its recipe did not work for me - the tests are still running too slowly.
Has anyone experienced this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shqn, 2015-04-29
@shqn

Maybe it will come in handy for someone: the reason turned out to be in the large sizes of the javascript objects that were on the page. It can be cured by moving some of its parts into separate objects. Something like that:

// Problem
var complexObject = {
    id: 123,
    name: "Object 123",
    foo: {...}, // Много данных
    bar: {...} // Много данных
};

// Solution
var fooObject = {
    // ...
};
var barObject = {
    // ...
};

var complexObject = {
    id: 123,
    name: "Object 123",
    foo: fooObject
    bar: barObject
};

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question