java - What is the difference between automating using http requests vs selenium webdriver? -


i bot developer in selenium webdriver java , i'm using browser htmlunitdriver headless it's complicated when have deal javascript, so, better when have automate page? sending http , post requests or continue using webdriver?

i'm confused because, example, how can click button , wait page load (example: when open page ad.fly) , have wait 5 seconds until button ready sending http request, confused by, lot answers!!

use http requests if want make calls (i.e. rest services). use selenium (or other web automation tools) if need simulate browser behaviour (i.e. run javascript in page). http preferable if have option - services more stable page structure (particularly if there's published interface) , more oftened designed machine-readable. web pages designed humans using web browsers, can change frequently, , adds lot of overhead doesn't make sense in machine interface.

so, i'd suggest - through sequence of user actions you're trying automate. if can express simple sequence of http requests, i'd way. if need run client-side javascript, or use other browser functionality, use selenium.


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -