html - 机器人框架: How to locate a input text field and how to input a value in it

标签 html selenium selenium-chromedriver robotframework rpa

I have a search field in the web page that I would like to locate and search the extension in the page and click on the first search that comes in. Below is the page snippet and HTML code.

我的 HTML 是这样的:

<input type="text" placeholder="Search for extensions" class="user-input" style="width: 370px;">

如果我尝试获取 html 路径的 Xpath,我会得到以下输入文本路径,但我也无法输入任何文本并得到以下错误

Element with locator 'xpath://*[@id="extensions-container"]/div/div[3]/div2/div2/div/div2/form/span2/input' not found.

Click Element    name:extensions
Input Text       xpath://*[@id="extensions-container"]/div/div[3]/div[1]/div[1]/div/div[1]/form/span[1]/input    cli 

最佳答案

这应该有效:

Input Text    css:input[placeholder="Search for extensions"]    cli

关于html - 机器人框架: How to locate a input text field and how to input a value in it,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64087840/

相关文章:

php - 如何将按钮添加到侧边栏小部件?

javascript - 文本区域和更改

python - 如何从span类获取content属性的值

java - 从下拉列表中选择元素

java - Maven 存储库中的 ChromeDriver 未在测试脚本中执行

javascript - 如何从 json 文件创建菜单

html - CSS 方向(横向|纵向)未按预期工作

R - 使用 PhantomJS 等待页面在 RSelenium 中加载

通过 Selenium chromedriver 进行 Python 代理身份验证

google-chrome - Selenium 打开未登录 Chrome 帐户的 chrome