views:

168

answers:

1

I have added a custom action to the CustomList type. For testing purposes I would like to exercise my new custom action using our testing harness. Unfortunately, I don't know how I can generate an ID for my custom menu item!

Here is an example (XPath expression) for the 'Delete Item' built-in menu option:

/body/div/div/table/tbody/tr[@id='mp10_0_2']/td/table/tbody/tr/td[@id='ID_DeleteItem']/label/div/span[1]

And here is the same for my custom action:

/body/div/div/table/tbody/tr[@id='mp13_0_6']/td/table/tbody/tr/td[@class='ms-MenuUILabel']/div/span[1]

As you can see, the in the second example (my custom action) contains a @class attribute, but no @id (which I would like to set when installing my custom action).

How can I specify an id attribute (which shows up in HTML) for my custom action?

+1  A: 

If it's just for testing you probably don't want to be digging into SharePoint internals to get control over the id. You should be testing for the presence of an item labeled "Delete Item", not for one with a particular id.

Tom Clarkson
Yes, it is just for testing. I was hoping there would be an attribute I could set in one of the XML files, but alas it appears that's not the case. Your suggestion was indeed our backup plan.
Philipp Schmid