当下面这样时在第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. Expected one result (or null) to be returned by selectOne(), but found 2

    这个问题在于你查询sql返回结果是多个值.一个集合,但是你在service的实现层的dao都调用了.get方法.而是应该使用.getlist方法等.

  2. C# 解析 Json数据

    JSON(全称为JavaScript Object Notation) 是一种轻量级的数据交换格式.它是基于JavaScript语法标准的一个子集. JSON采用完全独立于语言的文本格式,可以很容易在 ...

  3. KMP匹配算法

    先来说一下回溯法匹配字符串: 对于主字符串有一个target_index,以target_index(不动)为起点,匹配字符串pattern的长度+target_index为终点,逐个进行比较,当发现 ...

  4. 需要一个策略文件,但在加载此媒体时未设置checkPolicyFile标志

    LoaderContext的checkPolicyFile属性: 如果您从执行调用的 SWF 文件所在的域之外加载图像(JPEG.GIF 或 PNG),并且您预计将需要从 ActionScript 访 ...

  5. new(C# 参考)

    在 C# 中,new 关键字可用作运算符.修饰符或约束. new 运算符 用于创建对象和调用构造函数. new 修饰符 用于隐藏基类中被继承的成员. new 约束 用于在泛型声明中约束可能用作类型参数 ...

  6. Zookeeper的基础知识

    1.Zookeeper是什么? 引用官方的说法:“Zookeeper是一个高性能,分布式的,开源分布式应用协调服务.它提供了简单原始的功能,分布式应用可以基于它实现更高级 的服务.它被设计为易于编程, ...

  7. 安装pillow错误的解决方案

    错误信息: ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting        ...

  8. jquery 给input赋值错误写法

    <script type="text/javascript"> var ue = UE.getEditor('container'); function getCont ...

  9. python os模块

    import os path = "路径" os.getcwd() #获取当前工作目录,即当前python脚本工作的目录路径 os.chdir("dirname" ...

  10. DOCTYPE的详细图解

    之前有一次写代码的时候忘记写了<!DOCTYPE html> 导致样式的效果一直有点问题,查了很久才发现时候这个的锅.之后自己详细的来查找了DOCTYPE的作用. 在目前,基本上都是采用浏 ...