剧作家-TypeError:hoverElement.hover不是一个函数

问题描述

我正在尝试运行此

await hoverElement.hover();

以便鼠标将鼠标悬停在有问题的元素上

我收到一条错误消息,提示TypeError:hoverElement.hover不是函数

我正在阅读剧本API文档https://playwright.dev/#version=v1.5.2&path=docs%2Fapi.md&q=elementhandlehoveroptions

我在做什么错了?

test('Selection using hover Speak',async () => {

if (EnableTests.run_hover_speak === "true") {

    const expectedResult = TestPage.Div2_Expected_Result;
    const hoverElement = TestPage.Div2_css;

    await test_functions._hoverSpeak(page);
    await hoverElement.hover();

    const highlightedText =  await test_functions._hiliteSelection(page);
    const actual = JSON.stringify(highlightedText); console.log("ACTUAL RESPONSE " + actual);
    const expected = JSON.stringify(expectedResult); console.log("EXPECTED RESPONSE " + expected);
    assert(expected === actual);

};

});

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)