简体   繁体   English

Javascript 查询选择器

[英]Javascript querySelector

In Robot I have a keyword that inputs the name of the associate in the search field, then i submit the form.在 Robot 中,我有一个关键字,可以在搜索字段中输入同事的姓名,然后我提交表格。 It currently works only for a specific test account.它目前仅适用于特定的测试帐户。 I want to make that dynamic to work no matter what name I type.无论我键入什么名称,我都想让它动态工作。 Of-course as long as the name exist in our system当然,只要该名称存在于我们的系统中

Execute JavaScript  document.querySelector("#add_associate_089 > img").click();

add_associate_089 > img = the image we display next to the associate name in the results page contains the record id add_associate_089 > img = 我们在结果页面中显示在关联名称旁边的图像包含记录 ID

Im trying to make add_associate_ 089 dynamic this is the associate id we have in our database.我正在尝试使add_associate_089动态化,这是我们数据库中的关联 ID。

Any suggestions as to how I can accomplish this in robot?关于如何在机器人中完成此操作的任何建议?

You can try: [id^="add_associate_"] > img - this will select anything where id starts with that.您可以尝试: [id^="add_associate_"] > img - 这将是 select id 开头的任何内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM