首页 > 代码库 > selenium测试(Java)-- 验证信息(八)

selenium测试(Java)-- 验证信息(八)

package com.test.validationinfor;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class ValidationInformation {

    public static void main(String[] args) {


        WebDriver driver = new FirefoxDriver();    
        driver.get("http://www.baidu.com");
        driver.manage().window().maximize();
        
        
        System.out.println("CurrentUrl: "+driver.getCurrentUrl());
        
        //System.out.println("PageSource: "+driver.getPageSource());
        
        System.out.println("Title: "+driver.getTitle());
        
        System.out.println("WindowHandle: "+driver.getWindowHandle());
        
        System.out.println("hashCode: "+driver.hashCode());
        
        driver.quit();
        
    }

}

运行结果:

CurrentUrl: https://www.baidu.com/
Title: 百度一下,你就知道
WindowHandle: {faa8c575-8918-457c-9765-0c227def08f4}
hashCode: 112302969

selenium测试(Java)-- 验证信息(八)