Jump to content

Can't label be set with _WD_ElementAction?


Recommended Posts

I want to change the value of a label:

...
; XPath: //*[@id="primary_color_tshirt"]/div/a/label
$sButton_T_SHIRT_COLOR = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//div[@id='primary_color_tshirt']/div/a/label")
_WD_ElementAction($sSession,$sButton_T_SHIRT_COLOR,'value', 'Yellow')
...

But I get this error messages:

... $sData={"id":"26fb8bb5-bbef-4a3a-a553-bc3c99186211", "text":"Red"} ...
_WD_ElementAction: {"value":{"error":"element not interactable","message":"element not interactable\n  (Session info: c...
_WD_ElementAction ==> Webdriver Exception: {"value":{"error":"element not interactable","message":"element not interactable\n

I think this could be the problem:

a) A label can't be changed at all with AutoIt.

b) The platform protects the label from being changed.

c) The path is wrong (what I don't think because the label is found ($sData={"id":"26fb8bb5...)

So does anybody know a way to change the label or isn't it possible?

Edited by AI123
Link to post
Share on other sites
1 hour ago, Danp2 said:

From the standards doc --

image.thumb.png.d5c6eeaa8dde931b30161f7afb1a89fa.png

So, you can't change a label's text using _WD_ElementAction. While I haven't tried it, I think this should be possible using _WD_ExecuteScript to make the change using Javascript.

 

Ok, thank you.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...