Calling Remote Servers

Understanding Calling Remote Servers

Calling Remote Servers

Let’s understand calling Remote Servers. But before this, let’s have a look at Capybara. So, Capybara provides developers to simulate a user on a web page as well as make assertions based on the content and environment of the page. It also offers an API to interact with the web page.

A remote procedure call (RPC) is when a computer program source a procedure (subroutine) to execute in a different address space. Further, this is coded as if it were a normal (local) procedure call, without the programmer explicitly coding the details for the remote interaction. Moreover, the programmer copies essentially the same code whether the subroutine is local to the executing program or remote.

Normally Capybara expects to be testing an in-process Rack application, but you can also use it to talk to a web server running anywhere on the internet, by setting app_host:

Capybara.current_driver = :selenium

Capybara.app_host = ‘http://www.google.com’

visit(‘/’)

the default driver (:rack_test) does not support running against a remote server. With drivers that support it, you can also visit any URL directly:

visit(‘http://www.google.com’)

By default Capybara will try to boot a rack application automatically. You might want to switch off Capybara’s rack server if you are running against a remote application:

Capybara.run_server = false

Make your resume stand out and become a Certified Capybara Testing Professional. Try free practice tests here!

A great career is just a certification away. So, practice and validate your skills to become a Certified Capybara Testing Professional.

Asynchronous JavaScript (Ajax and friends)
Using the sessions manually

Get industry recognized certification – Contact us

keyboard_arrow_up