无法在selenium中找到元素错误

时间:2016-05-20 06:15:52

标签: java selenium selenium-webdriver

HTML:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

   <LinearLayout
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:orientation="horizontal">
       <EditText
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:id="@+id/et1"
           android:layout_weight="0.1"
           android:focusableInTouchMode="true"
           android:nextFocusDown="@+id/et2"/>
       <TextView
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:id="@+id/tv1"
           android:text="Save"
           android:textSize="20sp"
           android:layout_margin="10dp"/>

   </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/et2"
            android:layout_weight="0.1"
            android:nextFocusUp="@id/et1"/>
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Save"
            android:id="@+id/tv2"
            android:textSize="20sp"
            android:layout_margin="10dp"/>
    </LinearLayout>


</LinearLayout>

我的代码:

<a class="pointer" ng-click="openLogin()">Log In</a>

我得到的错误:

  

没有这样的元素:无法找到元素:{“method”:“link   text“,”selector“:”登录“}(会话信息:chrome = 48.0.2564.116)
  (司机信息:chromedriver = 2.21.371459   (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform = Windows NT 6.1 SP1   x86_64)(警告:服务器没有提供任何堆栈

1 个答案:

答案 0 :(得分:0)

如果有效,请查看

//*[@ng-click='pointer']
相关问题