Friday, 4 August 2017

Code Example - Get Current URL

package com.seleniumWebdriver;

import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

/**
 * @Blog Name : Selenium Code Example
 * @author Deepak Gupta
 * @Created Date 4-08-2017
 *
 */
public class GetCurrentURL extends SuperTestNG {

@Test
public void handleGetCurrentURLExample() {
try {
driver.get("http://www.google.com");
System.out.println("Current URL: " + driver.getCurrentUrl());
Thread.sleep(2000);
} catch (Exception e) {
e.printStackTrace();
}
}
}

No comments:

Post a Comment

Code Example - File Download By Robot Class In Firefox Browser

Exported from Notepad++ package com . practiceCode ; import java . awt . AWTException ; import java . awt . Robot ; import j...