当下面这样时在第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. JS绑定JavaScript事件

    //onblur="onblurs(this)" // function onblurs(e) { // alert(e.value); // }

  2. install LLVM

    version >= 3.8.0 $ cd llvm... $ mv someofClang ./tools $ mkdir build $ cd build $ cmake -DCMAKE_B ...

  3. java_js_json_日期格式化

    调用方法: var createBeginTime= createBeginTime.Format("yyyy-MM-dd 00:00:00"); 方法: Date.prototy ...

  4. 【译】RabbitMQ:发布-订阅(Publish/Subscribe)

    在前一篇教程中,我们创建了一个工作队列,我们假设在工作队列后的每一个任务都只被调度给一个消费者.在这一部分,我们将做一些完全不一样的事情,调度同一条消息给多个消费者,也就是有名的“发布-订阅”模式.为 ...

  5. JavaWeb 学习001-登录页面-Servlet

    那什么是Servlet呢? 我理解的Servlet 就是一个中间媒介,jsp页面原本需要一些操作,但是现在让jsp页面只是显示就好,把操作的工程转移给Servlet中. 使用Servlet时候有个固定 ...

  6. 2-6 Working with Lambdas

    在C++中使用匿名函数,格式如下:[] () {}; Using a Lambda to Print array Values #include <algorithm> #include ...

  7. Linux新建用户无法使用tab补全的修改办法

    原因: Root用的是/bin/bash 新增用户默认用的是/bin/sh,用ls -l /bin/sh发现 ->dash,修改下连接即可正常使用:

  8. [译]关于iOS和OS X废弃的API你需要知道的一切

    原文: Everything You Need to Know about iOS and OS X Deprecated APIs 如你所知,已废弃(Deprecated)的API指的是那些已经过时 ...

  9. aa3

    var geoCoordMap = { "海门":[121.15,31.89], "鄂尔多斯":[109.781327,39.608266], "招远 ...

  10. arcgis操作笔记-根据属性提取某区域要素

    1. 提取