0

我正在使用 Playwright 为 SAP Web 应用程序创建一个测试。我无法让它单击按钮或将所选 ID 的输入与 Playwright 一起使用。它正确选择(突出显示)按钮和输入字段,但没有任何反应。

其他 SAP 应用程序中的所有字段和按钮也会发生这种情况。我在错误的元素上吗?如何选择输入或按钮的正确元素/层?

我试过 Typescript 和 Python 的行为是一样的。

我的代码是:

import { test, expect } from "@playwright/test"

test.only("initial test", async ({ page }) => {
  test.setTimeout(600000)
  await page.goto("https://*some*intranet*site")
  const mail = "myname@mycompany.com"
  await page.type("#i0116", mail)
  await page.click("text=Next")
  await page.pause()
// Both not working:
  await page.type('#__xmlview2--CICO_TIME-Picker-inner', '12:01')
  await page.fill('#__xmlview2--CICO_TIME-Picker-inner', '12:01')
})

输入标签如下所示:

<input id="__xmlview2--CICO_TIME-Picker-inner" placeholder="HH:mm" value="10:54" role="combobox" aria-labelledby="__xmlview2--CICO_TIME-Picker-labelledby" aria-roledescription="Zeiteingabe" aria-autocomplete="none" aria-haspopup="dialog" aria-expanded="false" aria-owns="__xmlview2--CICO_TIME-Picker-clocks" autocomplete="off" class="sapMInputBaseInner">

在此处输入图像描述

4

0 回答 0