codeceptjs / codeceptjs/CodeceptJS

Unable to use xpath properly with Appium Helper

オープン
#1,318 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
4.2k
フォーク
757
平均マージ
2日 9時間
マージ済み PR(30日)
16

説明

#### What are you trying to achieve?
Click on a app object when using xpath to select the second element with the same text

#### What do you get instead?
When I use I.click('//*[@text="6º ano"]') it works
As I have several elements with the same text on the screen and I woul like to click on the second
I.click('(//*[@text="6º ano"])[2]') is not able to find any element

> Provide console output if related. Use `--verbose` mode for more details.

```bash
Emitted | step.passed (I wait for visible "(//*[@resource-id="...
Emitted | step.finish (I wait for visible "(//*[@resource-id="...
Emitted | step.start (I click "(//*[@text="6º ano"])[2]")
I click "(//*[@text="6º ano"])[2]"
[1] Error | Error: Clickable element android=new UiSelector().text("(//*[@text="6º ano"])[2]") was n...
Emitted | step.failed (I click "(//*[@text="6º ano"])[2]")
Emitted | step.finish (I click "(//*[@text="6º ano"])[2]")
[1] Error | Error: Clickable element android=new UiSelector().text("(//*[@text="6º ano"])[2]") was n...
Clickable element android=new UiSelector().text("(//*[@text="6º ano"])[2]") was not found by text|CSS|XPath
```

> Provide test source code if related

```js
I.click('(//*[@text="6º ano"])[2]')
```

### Details

* CodeceptJS version:v1.4.5
* NodeJS Version:v8.11.4
* Operating System:Windows 7
* Appium: 1.9.1

When using the appiun session to inspect. it is able to locate the object
When playing the script even making sure the page is fully loaded script is not able to locate the second instance of the object.
For this instance
I.waitForVisible('(//*[@text="Ciências"]/../..//android.widget.TextView)[2]',10);
Script is able to detect the instance
When clicking, it cant be detected

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。