I am currently doing automation for uploading file in saleforce.
The HTML text is:
<div>
<a href="javascript:void(0);" onblur="chatter.getFeed().contentCommentActionBlur(this);" onfocus="chatter.getFeed().contentCommentActionFocus(this);" onclick="chatter.getFeed().createContentComment(this,'0D52700002cc67d', false, true);" onmousedown="chatter.getFeed().contentCommentActionMouseDown(this);" class="cxcontentcommentaction">
<img class="cxcontentcommentactionimg" src="/s.gif">
<span class="cxcontentcommentactiontext">Attach File</span>
</a>
</div>
For click the anchor user need to go down and press "Attach file" button.
I have tried with two different doing
1.Coding get element by anchor class="cxcontentcommentaction":
Set htmldoc = mydoc.getElementsByClassName("cxcontentcommentaction")
htmldoc.Click
2.Coding get element by span class="cxcontentcommentactiontext":
Set htmldoc = mydoc.getElementsByClassName("cxcontentcommentactiontext")
htmldoc.Click
For both I am getting error "Object doesn't support this property
After your comment, i have tried like this,
Set oElementCollection = mydoc.getElementsByClassName("cxcontentcommentactiontext")
For Each link In oElementCollection
If link.innerHTML = "Attach File" Then
link.Click
Exit For
End If
Next link
I have tried for below HTML
<a href="javascript:window.invokeOnClickJS_00bG0000000ikPK%28this%29" class="menuButtonMenuLink">
Send an Email</a>
Below code is working properly for above html
Set oElementCollection = mydoc.getElementsByClassName("menuButtonMenuLink")
For Each link In oElementCollection
If link.innerHTML = "Send an Email" Then
link.Click
Exit For
End If
Next link
But with "Attach File" button which mentioned in this question only getting problem.
Forms(0).Submit
changing0
to the correct index. – SierraOscar