How to get current path with query string using capybara?

Member

by adan , in category: Third Party Scripts , 5 months ago

How to get current path with query string using capybara?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by haylee.mertz , 5 months ago

@adan 

To get the current path with query string using Capybara, you can use the current_url method.


Here's an example:

1
current_url = page.current_url


This will return the current URL of the page, including the query string if it exists. You can then capture this URL and use it as needed in your tests.

Related Threads:

How to get current path of .htaccess file?
How to get current path in fastapi with domain?
How to get the html in an element using capybara?
How to get the current active view in a region using prism?
How to get current time in hh:mm:ss format using moment in react.js?
How to get query string on search page in shopify?