zoukankan      html  css  js  c++  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

  • 相关阅读:
    开发细节
    html
    java学习
    Promise对象
    强制转换和隐式转换
    借助防抖解决输入框的非空校验
    setTimeout
    Symbol类型
    js API
    vue 使用mixin
  • 原文地址:https://www.cnblogs.com/xinxin1994/p/7289539.html
Copyright © 2011-2022 走看看