当下面这样时在第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. linux 软件的安装与Tarball

    Linux 系统上真正认识的可执行文件其实是二进制文件 ( binary program ) shell scripts 只是利用 shell (例如 bash) 这支程序的功能进行一些判断式,而最终 ...

  2. 查询AD账号的SID

    在非域控的计算机上可以查询所用AD用户的SID,不过现成的工具不能直接实现此目的,我们需要在这些计算机上安装RSAT(远程服务器管理工具),然后使用dsquery和dsget命令,来快速查询AD用户的 ...

  3. XAF进修二:在XAF中打开自定义的WinForm

    在建造WinForm时须要加上一机关函数和Show办法 using System; using System.Collections.Generic; using System.ComponentMo ...

  4. jquery from提交和post提交

    //from 提交 function login(){    $('#login_form').form('submit',{              url: '../../../bagechux ...

  5. <button> 标签 id 与 function 重复时发生的问题

    今天遇到一种情况,在调用js自定义方法的时候,总是提示“import:660 Uncaught TypeError: ... is not a function”. 仔细检查了代码,并没有问题.甚至把 ...

  6. iOS强制横屏

    由于项目需求,需要整个项目页面都是竖屏,唯独一个折线图页面强制性横屏显示. 网上逛了许多帖子,也看了好多大神的提供的方法,都没能够实现本屌丝想要的效果.没办法自己研究自己搞,借鉴各路大神的思路,最后费 ...

  7. JavaScript Window 对象

    < JavaScript Window Object > && < IE check > JavaScript Window Object Window.loa ...

  8. Phpstorm 设置取消自动保存

    个人通过使用,发现PhpStorm的确是 编辑PHP 的神器,提供用户效率,提供智能代码补全,快速导航以及即时错误检查. 不过,让我用起来不爽的是,它会自动保存,还不能使用快捷键Ctr+Z来撤销,也就 ...

  9. docke部署mysql

    #1    docker pull mysql #2    docker run -v /data/var/mysql/:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=k ...

  10. SQL存储过程删除数据库日志文件的方法

    --日志文件收缩至多少M DECLARE @DBLogSise AS INT SET @DBLogSise=0 --查询出数据库对应的日志文件名称 DECLARE @strDBName AS NVAR ...