当下面这样时在第7行会提示:Cannot refer to an instance field pageTitle while explicitly invoking a cons


 public class LoginPage extends PageBase{
// private WebDriver driver;
// private final static
String pageTitle = "登录 - BugFree"; public LoginPage( WebDriver driver){
super(driver, pageTitle); //显示调用父类的构造函数,而且必须是第一行调用
URL="http://192.168.1.151:8080/bugfree/index.php/site/login"; }

--解决方法:在第4行变明前加上“ static”就不会报错了。

 

Cannot refer to an instance field pageTitle while explicitly invoking a cons的更多相关文章

  1. 转-Cannot refer to an instance field arg while explicitly invoking a constructor

    编译失败: Cannot refer to an instance field arg while explicitly invoking a constructor  调用方法时不能引用一个实例变量 ...

  2. Effective Java 31 Use instance fields instead of ordinals

    Principle Never derive a value associated with an enum from its ordinal; store it in an instance fie ...

  3. Effective Java 77 For instance control, prefer enum types to readResolve

    The readResolve feature allows you to substitute another instance for the one created by readObject ...

  4. A const field of a reference type other than string can only be initialized with null Error [duplicate]

    I'm trying to create a 2D array to store some values that don't change like this. const int[,] hiveI ...

  5. android jni ——Field & Method --> Accessing Field

    现在我们知道了怎样使用native code访问简单的数据类型和引用参考类型(string,array),下面我们来介绍怎样让jni代码去访问java中的成员变量和成员函数,然后可以再jni中回调ja ...

  6. 【反射】Reflect Class Field Method Constructor

    关于反射 Reflection 面试题,什么是反射(反射的概念)? 主要是指程序可以访问,检测和修改它本身状态或行为的一种能力,并能根据自身行为的状态和结果,调整或修改应用所描述行为的状态和相关的语义 ...

  7. Beginning Scala study note(3) Object Orientation in Scala

    1. The three principles of OOP are encapsulation(封装性), inheritance(继承性) and polymorphism(多态性). examp ...

  8. android 官方文档 JNI TIPS

    文章地址  http://developer.android.com/training/articles/perf-jni.html JNI Tips JNI is the Java Native I ...

  9. CLR via C# 3rd - 05 - Primitive, Reference, and Value Types

    1. Primitive Types        Any data types the compiler directly supports are called primitive types. ...

随机推荐

  1. greendao对SQLite数据库的增删改查操作

    利用greendao操作数据库时,都是以对象或者对象的list来进行增删改查的操作,操作的结果都是用一个list来接收的!!! 1.增加一条记录 Stu stu01=new Stu();stu01.s ...

  2. 'autocomplete="off"'在Chrome 中不起作用

    大家都知道autocomplete属性是表单字段中的HTML5新属性,该属性有两种状态值,分别为"on" 和 "off",该属性可省略:省略属性值后默认值为&q ...

  3. Python模块:itertools

    itertools模块:循环器 一,无穷循环器:count,cycle,repeat (1)count(5,3) #从5开始的整数循环器,每次增加3,即:5,8,11,14,17... from it ...

  4. iOS.Animation.Math-behind-CATransform3D

    iOS CoreAnimation: Math behind CATransform3D 1. What's CATransform? Matrix Transform: "User spa ...

  5. inotify resources exhausted

    inotify resources exhausted tail -f /var/log/kubelet.log tail: inotify resources exhausted tail: ino ...

  6. mysql备份文件注释乱码处理工具

    我们有时候需要做mysql数据库的注释,可是备份出来的是乱码,怎么办呢? 本工具软件来帮你的忙. 将GBK库备份后的文本文件中夹带的UTF8乱码转换为GBK编码,就不再乱码了. http://down ...

  7. 多个插件依赖不同版本jQuery问题解决案例

     <script src="../../../js/jquery-1.3.2.min.js" type="text/javascript">< ...

  8. free-electrons linux内核和驱动

    操作系统的三个作用:1.管理硬件资源:2.提供独立于架构和硬件的可移植的软件接口3.处理不同应用对相同硬件资源的同时访问 系统调用接口是稳定的,系统调用由c函数库封装,用户程序基本不需要直接调用系统函 ...

  9. 用Backbone.js创建一个联系人管理系统(三)

    原文: Build a Contacts Manager Using Backbone.js: Part 3 欢迎回到这系列的教程,关注使用Backbone.js构建应用程序. 如果你还没看过第一,二 ...

  10. 工程BUG记录

    前天项目中,有个 id 对象,命名成了 initA...  从该页面点击进入其他时没有问题,但是在返回到该页面后,程序崩溃了,报了野指针,后来在跳转传值的时候,发现这个异常.我猜测原因可能是 xcod ...