首页 > 解决方案 > Selenium VBA 更改属性

问题描述

这是我的html代码:

<input id="drugCodeId_focus" name="drugCodeId_focus" type="text" autocomplete="off" role="combobox" aria-haspopup="true" aria-expanded="false" aria-autocomplete="list" aria-owns="drugCodeId_items" aria-activedescendant="drugCodeId_25" aria-describedby="drugCodeId_25" aria-disabled="false">

这是一个组合框,更改后“aria-activedescendant”的属性值和组合框的“aria- describeby”值将发生变化。帮助我将示例值“drugCodeId_25”更改为“drugCodeId_26”。

标签: vbaselenium-webdriver

解决方案


你需要这个吗

driver.FindElementByXPath(".//input[@id='drugCodeId_focus']").SendKeys("your text here")

推荐阅读