当下面这样时在第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. pandas中将timestamp转为datetime

    参考自:http://stackoverflow.com/questions/35312981/using-pandas-to-datetime-with-timestamps 在pandas Dat ...

  2. sugar 自动为DP 加cache (or打表)

    // from http://www.csdn.net/article/2015-12-03/2826381 #include <iostream> #include <tuple& ...

  3. libcurl 函数curl_easy_perform在release下崩溃的问题

    今天遇到一个很奇怪的问题: 工程中用到了libcurl, debug可以正常运行,release每次都崩溃,断到curl_easy_perform这一行.堆栈中也得不到有用信息,于是GOOGLE一番, ...

  4. Oracle学习线路

    出自huyangg的博客,地址是:oracle学习路线图 1.sql.pl/sql(网上有很多的视频,可以做一个简单的入手,然后看几本书,多做实验)    作为oracle的基本功,需要大家对sql和 ...

  5. 决策树(含python源代码)

    因为最近实习的需要,所以用python里的sklearn包重新写了一次决策树 工具:sklearn,http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy:将 ...

  6. linux下python调用c模块

    在C调用Python模块时需要初始化Python解释器,导入模块等,但Python调用C模块却比较简单,下面还是以helloWorld.c 和 main.py 做一说明:   (1)编写C代码,hel ...

  7. sap MD04中常用函数

    1. 需求溯源 : MD_PEGGING_NODIALOG 2. 实时库存 : MD_STOCK_REQUIREMENTS_LIST_API 这个函数中MDPSX 和 MDEZX 是通过 MDPS 的 ...

  8. iOS相册中图片按照时间排序

    ios相册默认是按照时间从过去到现在排列,图片顺序有正序和逆序,group可以用以下方法来选择顺序 /** @param NSIndexSet 需要获取的相册中图片范围 @param NSEnumer ...

  9. iava多线程详解(2)-成员变量与局部变量访问

    有两段代码 1.线程访问成员变量 public class FirstThreadTest { public static void main(String[] args) { FirstThread ...

  10. oracle pl/sql split函数

    在软件开发过程中程序员经常会遇到字符串的拼接和拆分工作. 以java开发为例: 前台传入字符串拼接形式的一个JSON数据,如:"1001,1002,1003",这可能代表了一组序号 ...