Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Se (3)-print page information

Shulou Source: shulou.com Published: 2022-06-03 06:56:31 11月23日 Update

package test;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

import org.testng.annotations.Test;

public class webpage {

@Test

public void test() throws InterruptedException{

System.setProperty("webdriver.chrome.driver", "D:/01 Learn WebDriver/chromedriver.exe");

WebDriver dr = new ChromeDriver();

dr.manage().window().maximize();

dr.get("http://www.baidu.com");

//If there are redirects, wait a few seconds before printing

System.out.println("The Title is:"+dr.getTitle());

System.out.println("Current URL is:"+dr.getCurrentUrl());

Thread.sleep(3000);

dr.quit();

}

}

Tags: Information page Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi OPPO Reno macOS Shulou Tech Info Microsoft