Selenium Webdriver Scripts
[Link]
For more Selenium Webdriver Scripts Visit - [Link]
Selenium Webdriver Scripts 1. get( ) - Selenium WebDriver method to open the specified URL page public class Sample { public static void main(String[] args) { WebDriver driver = new FirefoxDriver(); [Link]("[Link] } } Opens google page [Link]() - Returns The title of the current page public class Sample { { public static void main(String[] args) WebDriver driver = new FirefoxDriver(); [Link]("[Link] [Link]([Link]()); } } Output- QTP Scripts and Selenium Webdriver Scripts
For more Selenium Webdriver Scripts Visit - [Link]
3. getCurrentUrl() - Returns The URL of the page currently loaded in the browser public class Sample { { public static void main(String[] args) WebDriver driver = new FirefoxDriver(); [Link]("[Link] [Link]([Link]()); } }
Output - [Link] 4. getPageSource() - Returns the source code of the page public static void main(String[] args) { WebDriver driver = new FirefoxDriver(); [Link]("[Link] [Link]([Link]()); } }
For more Selenium Webdriver Scripts Visit - [Link]
5. close() - Closes the current window
public class Sample { { public static void main(String[] args) WebDriver driver = new FirefoxDriver(); [Link]("[Link] [Link](); } }
[Link] to Maximize browser window in Selenium Web Driver public class Sample { public static void main(String[] args) { WebDriver driver = new FirefoxDriver(); [Link]("[Link] [Link]().window().maximize(); } }
For more Selenium Webdriver Scripts Visit - [Link]
7. How to get label text or capture label text in Selenium webdriver
public class Sample { public static void main(String[] args) { WebDriver driver = new FirefoxDriver(); [Link]("[Link] [Link]([Link]([Link]("btnK")).g etText()); }
Output- Google Search
For more Selenium Webdriver Scripts Visit - [Link]