latteart-org / latteart

Apache License 2.0
39 stars 13 forks source link

ファイルアップロードのあるシナリオをリプレイするとSyntaxErrorが発生した #1489

Open btuenomso opened 2 months ago

btuenomso commented 2 months ago

Describe the bug ファイルアップロードのあるシナリオをリプレイすると、ファイルアップロードのタイミングでSyntaxErrorが発生した。

■Latteart上の表示 通番 ページタイトル 要素タグ テキスト イベント種別 入力値 時刻
19 入力画面 SMALL アップロード click   16:18:56
20 入力画面 INPUT   change C:\fakepath\ダミーPDF.pdf 16:19:09

■リプレイ実行時のlatteart-v2.15.1-win/latteart-capture-cl/logs/latteart-capture-cl.log

[2024-09-19T16:27:24.392] [INFO] default - Run operation.
[2024-09-19T16:27:24.392] [DEBUG] default - {"input":"C:\\fakepath\\ダミーPDF.pdf","type":"change","elementInfo":{"tagname":"INPUT","text":"","value":"C:\\fakepath\\ダミーPDF.pdf","xpath":"","attributes":{"class":"ng-hide __LATTEART_OPERATION_TARGET_ELEMENT__","aria-hidden":"true","ng-file-select":"onAttachmentSelect($files)","type":"file","ng-show":"false"},"boundingRect":{"top":0,"left":0,"width":0,"height":0},"innerHeight":909,"innerWidth":1920,"outerHeight":1056,"outerWidth":1936,"checked":false},"clientSize":{"width":1936,"height":1056},"scrollPosition":{"x":0,"y":0}}
[2024-09-19T16:27:25.243] [DEBUG] default - focusWindow: C65693F0CC760ED3CCB15E9C840CABEB
[2024-09-19T16:27:25.494] [DEBUG] default - removeScreenLock
[2024-09-19T16:27:25.495] [DEBUG] default - clearAndSendKeys: xpath = , value = C:\fakepath\ダミーPDF.pdf
[2024-09-19T16:27:25.523] [WARN] default - InvalidSelectorError: invalid selector
from javascript error: {"status":32,"value":"Unable to locate an element with the xpath expression  because of the following error:\nSyntaxError: Failed to execute 'evaluate' on 'Document': The string '' is not a valid XPath expression."}
  (Session info: chrome=128.0.6613.138)
[2024-09-19T16:27:25.524] [WARN] default - Retry.
[2024-09-19T16:27:25.537] [WARN] default - InvalidSelectorError: invalid selector
from javascript error: {"status":32,"value":"Unable to locate an element with the xpath expression  because of the following error:\nSyntaxError: Failed to execute 'evaluate' on 'Document': The string '' is not a valid XPath expression."}
  (Session info: chrome=128.0.6613.138)
[2024-09-19T16:27:25.537] [WARN] default - Retry.
[2024-09-19T16:27:25.550] [WARN] default - InvalidSelectorError: invalid selector
from javascript error: {"status":32,"value":"Unable to locate an element with the xpath expression  because of the following error:\nSyntaxError: Failed to execute 'evaluate' on 'Document': The string '' is not a valid XPath expression."}
  (Session info: chrome=128.0.6613.138)
[2024-09-19T16:27:25.551] [WARN] default - Retry.
[2024-09-19T16:27:25.562] [WARN] default - InvalidSelectorError: invalid selector
from javascript error: {"status":32,"value":"Unable to locate an element with the xpath expression  because of the following error:\nSyntaxError: Failed to execute 'evaluate' on 'Document': The string '' is not a valid XPath expression."}
  (Session info: chrome=128.0.6613.138)
[2024-09-19T16:27:25.562] [WARN] default - Retry.
[2024-09-19T16:27:25.575] [WARN] default - InvalidSelectorError: invalid selector
from javascript error: {"status":32,"value":"Unable to locate an element with the xpath expression  because of the following error:\nSyntaxError: Failed to execute 'evaluate' on 'Document': The string '' is not a valid XPath expression."}
  (Session info: chrome=128.0.6613.138)
[2024-09-19T16:27:25.575] [WARN] default - Retry.
[2024-09-19T16:27:25.590] [WARN] default - InvalidSelectorError: invalid selector
from javascript error: {"status":32,"value":"Unable to locate an element with the xpath expression  because of the following error:\nSyntaxError: Failed to execute 'evaluate' on 'Document': The string '' is not a valid XPath expression."}
  (Session info: chrome=128.0.6613.138)
[2024-09-19T16:27:25.591] [WARN] default - Retry.
[2024-09-19T16:27:25.605] [WARN] default - InvalidSelectorError: invalid selector
from javascript error: {"status":32,"value":"Unable to locate an element with the xpath expression  because of the following error:\nSyntaxError: Failed to execute 'evaluate' on 'Document': The string '' is not a valid XPath expression."}
  (Session info: chrome=128.0.6613.138)
[2024-09-19T16:27:25.606] [WARN] default - Retry.
[2024-09-19T16:27:25.619] [WARN] default - InvalidSelectorError: invalid selector
from javascript error: {"status":32,"value":"Unable to locate an element with the xpath expression  because of the following error:\nSyntaxError: Failed to execute 'evaluate' on 'Document': The string '' is not a valid XPath expression."}
  (Session info: chrome=128.0.6613.138)
[2024-09-19T16:27:25.619] [WARN] default - Retry.
[2024-09-19T16:27:25.633] [WARN] default - InvalidSelectorError: invalid selector
from javascript error: {"status":32,"value":"Unable to locate an element with the xpath expression  because of the following error:\nSyntaxError: Failed to execute 'evaluate' on 'Document': The string '' is not a valid XPath expression."}
  (Session info: chrome=128.0.6613.138)
[2024-09-19T16:27:25.633] [WARN] default - Retry.
[2024-09-19T16:27:25.648] [ERROR] default - invalid selector
from javascript error: {"status":32,"value":"Unable to locate an element with the xpath expression  because of the following error:\nSyntaxError: Failed to execute 'evaluate' on 'Document': The string '' is not a valid XPath expression."}
  (Session info: chrome=128.0.6613.138) : InvalidSelectorError: invalid selector
from javascript error: {"status":32,"value":"Unable to locate an element with the xpath expression  because of the following error:\nSyntaxError: Failed to execute 'evaluate' on 'Document': The string '' is not a valid XPath expression."}
  (Session info: chrome=128.0.6613.138)
    at Object.throwDecodedError (C:\snapshot\latteart\node_modules\selenium-webdriver\lib\error.js:522:15)
    at parseHttpResponse (C:\snapshot\latteart\node_modules\selenium-webdriver\lib\http.js:589:13)
    at Executor.execute (C:\snapshot\latteart\node_modules\selenium-webdriver\lib\http.js:514:28)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Driver.execute (C:\snapshot\latteart\node_modules\selenium-webdriver\lib\webdriver.js:740:17)
    at async toWireValue (C:\snapshot\latteart\node_modules\selenium-webdriver\lib\webdriver.js:141:15)
    at async C:\snapshot\latteart\node_modules\selenium-webdriver\lib\webdriver.js:191:16
    at async forEachKey (C:\snapshot\latteart\node_modules\selenium-webdriver\lib\webdriver.js:185:9)
    at async convertKeys (C:\snapshot\latteart\node_modules\selenium-webdriver\lib\webdriver.js:190:3)
    at async Driver.execute (C:\snapshot\latteart\node_modules\selenium-webdriver\lib\webdriver.js:738:22)
[2024-09-19T16:28:11.575] [INFO] default - operation

To Reproduce

  1. 設定 → 実験的機能設定 → 記録方式 → テスト対象ページ上の操作をPUSH形式で記録する を有効にする
  2. ファイルアップロードのある入力画面を対象に、テストを記録する
  3. 入力画面に従って、C:\\Users\[UserName]\Downloads\ダミーPDF.pdf をファイルアップロードを行う
  4. テスト記録を終了する
  5. 「テスト結果のリプレイ」を実行する
  6. リプレイ中のファイルアップロードのタイミングでSyntaxErrorが発生する

Expected behavior

テスト記録中にXPathが記録されていない

Screenshots

なし

Desktop (please complete the following information):

Smartphone (please complete the following information):

なし

Additional context

設定 → 実験的機能設定 → 記録方式 → テスト対象ページ上の操作をPUSH形式で記録する を無効にすると、テスト記録中にファイルアップロード自体ができないため有効にしている。

masaki-tajima commented 1 month ago

バグの起票、ありがとうございます。開発チームの但馬です。 本件、確かに再現することを確認しました。 「実験的機能」の設定を有効にして記録した場合は、正常に動作しない可能性があることは想定しています。

ただし、本件は記録まで正常に行えた上でリプレイ時に「SyntaxError」が起きているため、リプレイ側の機能の修正によって、比較的工数少なく解消できる可能性があります。 開発リソースが限られており、すぐの修正は難しい場合がありますが、優先度をつけて対応させていただきます。 今後ともよろしくお願いします。