-1

this is my html code:

<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">

this is a combobox and after change attribute value of "aria-activedescendant" and "aria-describedby" value of combobox will change. help me for change for expample value "drugCodeId_25" to "drugCodeId_26".

JeffC
  • 22,180
  • 5
  • 32
  • 55
  • This looks like HTML. What has it to do with VBA? – Paul Ogilvie May 21 '21 at 11:59
  • yes i wan to make a bot to change value combobox – Ruzbeh Adibi May 21 '21 at 12:00
  • Where are your code attempts? Trying to change attributes on an element is a sure way to cause unexpected behavior on the site. Instead of attempting to change element attributes, instead do whatever you are trying to do using steps a user would perform then automate those steps. – JeffC May 21 '21 at 18:13

1 Answers1

-1

Do you need this

driver.FindElementByXPath(".//input[@id='drugCodeId_focus']").SendKeys("your text here")
itronic1990
  • 1,231
  • 2
  • 4
  • 18
  • sendKeys for wich attribute? this id ("drugCodeId_focus") has a lot of attribute i want to change one them. this attribute ("aria-activedescendant") – Ruzbeh Adibi May 21 '21 at 15:35
  • see if this helps: -https://stackoverflow.com/questions/8473024/selenium-can-i-set-any-of-the-attribute-value-of-a-webelement-in-selenium – itronic1990 May 21 '21 at 17:17
  • OP is asking how to change an attribute of the element, not send keys to that element – JeffC May 21 '21 at 18:13