【问题标题】:Is it possible to simulate voice input using Selenium + Webdriver in end2end tests?是否可以在端到端测试中使用 Selenium + Webdriver 模拟语音输入?
【发布时间】:2021-10-27 01:15:26
【问题描述】:

我正在尝试在 Python(在 Chrome 上运行)中使用 Selenium + Webdriver 创建一个测试,以通过使用 mp3wav files 模拟语音输入来验证语音搜索。我已在Chrome capabilities 下方添加了flags,但仍然没有模拟语音输入。

--no-sandbox
--allow-file-access-from-files
--use-fake-device-for-media-stream
--use-fake-ui-for-media-stream
--use-file-for-fake-audio-capture="path-of-the-audio-file"

有没有一种方法可以在 E2E 测试中模拟语音输入?

【问题讨论】:

    标签: python selenium selenium-webdriver automated-tests webdriver


    【解决方案1】:

    是的,这是可能的。您可以使用 mp3 使用 google 翻译器 jar 将其转换为文本,然后您可以将该文本传递到文本框以执行搜索。

    【讨论】:

    • 另外贴出mp3转文本的代码。
    • @Nandan A : 此用户的声望不超过 75,因此无法发表评论。
    • @sukumar-k - 是的,但问题是在 UI 上,文本会在用户说话时出现(我们的 UI 类似于 youtube.com 上的语音搜索)。没有文本框。
    猜你喜欢
    • 1970-01-01
    • 2012-05-14
    • 1970-01-01
    • 1970-01-01
    • 2011-12-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-07-13
    相关资源
    最近更新 更多