SELENIUM : Which method is used to get the current URL of a web page in Selenium?
SDET Automation Testing Interview Questions & Answers
We will be covering a wide range of topics including QA manual testing, automation testing, Selenium, Java, Jenkins, Cucumber, Maven, and various testing frameworks.
SELENIUM : Which method is used to get the current URL of a web page in Selenium?
A) getCurrentURL()
B) getCurrentPageURL()
C) getPageURL()
D) getURL()
Write Answer in Comment.
Answer: A) getCurrentURL()
Explanation:
In Selenium, getCurrentURL() is used to retrieve the current URL of a web page. This method returns a String value that represents the URL of the current web page that the driver is on. getCurrentPageURL(), getPageURL(), and getURL() are not valid methods in Selenium.
Therefore, option A is the correct answer as it accurately describes the method used to get the current URL of a web page in Selenium. Option B, C, and D are incorrect as they describe invalid or irrelevant methods.