help please!!

17 views
Skip to first unread message

UserGR

unread,
Jun 1, 2017, 11:24:10 PM6/1/17
to Selenium Users
how can I grab Request URL under network tab. when you do vew->inspect, under net work tab, there is a pending Request URL. 
How can I grab that URL with java code in Selenium (Chrome browser). I need to append user/password to this Request URL to get pass through a blackbox where i cannot directly enter userid/pwd.

Appreciate any help!
Thanks!

Monika Singhal

unread,
Jun 2, 2017, 12:38:27 AM6/2/17
to Selenium Users

Hi,

You can directly get the request URL using selenium web driver. You don't have to inspect the element for this.

Syntax:
driver.getCurrentURL();

Login on any web page is the POST API call. You cannot login directly by appending user name and password in the current URL.

Thanks & Regards,
Monika

Monika Singhal

unread,
Jun 2, 2017, 12:41:07 AM6/2/17
to Selenium Users
Updating the code for fetching the current URL:

WebDriver driver = new WebDriver();
String url = driver.getCurrentUrl();
Reply all
Reply to author
Forward
0 new messages