3

I've heard of JS scripts on forms that listen on inputs for clicks and monitor input field values for change. These scripts are used to catch/block auto filling by bots.

With jQuery (NojeJS-WebKit (for automating like selenium)) you can set the value of the input by its attribute and submit the form by calling click on the button. This is all automated.

In phantomjs/selenium you can spin up a headless web-driver and get inputs, set values, and submit the form. Again this is all automated.

Question: What are the fundamental differences in how these implementations work?

For example: Selenium is advertised as behaving just like a human in the browser. Out of headless mode, you can actually SEE selenium inject/write the value into the form field, whereas jQuery does not.

Because of this, it is my understanding/belief that Selenium form automation can circumvent JS bot monitoring, while the same kind of automation in jQuery, (though much faster) will be detected.

Please share your knowledge on this topic. I have a particular interest in mimicking selenium's "human" behaviors strictly with jQuery because of the speed advantages.

MrPizzaFace
  • 7,807
  • 15
  • 79
  • 123
  • I think this question needs some clarification. Does "NojeJS-WebKit" refer to https://github.com/shama/nodewebkit? Does "Selenium" refer to Selenium RC (http://docs.seleniumhq.org/projects/remote-control/) or Selenium WebDriver (http://docs.seleniumhq.org/projects/webdriver/). Of course NodeJS-Webkit and Selenium are not exactly the same in every respect. They are similar in some aspects and different in others. Without a little more detail about what two products you are comparing and what kind of systems you are trying to circumvent, it's hard to know which aspects you are interested in. – jtmanteo Jun 01 '14 at 18:32

1 Answers1

1

If you are only comparing the auto fill forms case, there are not so much differences between the JavaScript and Selenium way.

  • The JavaScript(jQuery is a library of JavaScript) way injects the JavaScript code to browser, and then change the content of web pages.
  • The Selenium way uses the WebDriver protocol( http://www.w3.org/TR/webdriver/) to control the behavior of the web browser.

Both of them can change the web pages automatically.

But it is more powerful in Selenium. For example you can change the settings(User Agent/Size of browser/Plugins of browser, etc...) of the browser automatically. And you can programing in many languages(Java, Ruby, Python, JavaScript...) too.

andyf
  • 3,262
  • 3
  • 23
  • 37
  • I think I have answered the `fundamental differences`(JavaScript vs WebDriver). And I don't think your question is so `clearly` before you answer all questions from @jtmanteo – andyf Jun 07 '14 at 16:34