Using VBA to click on a button that has no "Id" nor "Value" I i can use to click - vba

I have tried different methods such as using trying to use the tab key to get to it but unfortunately it is not in the tabbing sequences, so I could not send the focus on it to be have my RPA click on it. Below is the HTML markup:
<td class="buttonSmall" onmouseout="this.className='buttonSmall'"
onmousedown="this.className='buttonSmallPressed'"
onmouseup="this.className='buttonSmall'"
onclick="openDualFacingWindow(getBillingCycleURL());">View</td>
Notice that I have tried to use the tag as follow
Set viewObject = Ie.document.getElementsByTagName("td")
For Each viewObj In viewObject
If viewObj.Value = "View" Then
viewObj.onclick
Exit For
End If
Next
It does not seems to work. Any help would be greatly appreciated

Related

Is there a way to click on anchor link

Please help me as the anchor tag looks like the below
<a title ="excel" class="activelink"style="Text-Decoration: none; onclick="$find('ReportViewerControl').exportReport('Excelopenxml');" href ="javascript:void(0)" alt="Excel" _selected="true"> Excel</a>
This doesn't have any document id or class.. Any help would be highly appreciated.
I try to check your HTML code and found that it contains the class but it can be possible that many other elements on the page using the same class. If you try to access the link using that class then it can possible that you click the incorrect element on the page.
We can see that the link contains the ' Excel' text. We can try to loop through all the links on the page and try to match the innerHTML to find that specific link.
Example:
'Below is code to loop through anchor tags, find the specific link, and click it.
Set elems = IE.document.getElementsByTagName("a")
For Each elem In elems
If (elem.innerHTML) = " Excel" Then
elem.Click
Exit For
End If
Next elem
Output:
In a similar way, you can also match other attributes from the anchor tag that may also help to click the link.
Note: This code example is for clicking the specific link on a page. It may not help you to automate the file download.
Further, you can try to modify the code example as per your own requirements.

Kendo-Vue Hide button in column?

i'm struggling with this one, i need to hide a button, i mean a command button based on the value of a column.
i grab the following example from kendo pages, i would like to show/hide the button "View Details" based on the "Discontinued" value.
i've already tested with :visible or :hide properties without success.
https://stackblitz.com/edit/e1fre3
does someone know how to get this working?
The command option is expecting string or array so this is an updated stackblitz example that worked at my side - https://stackblitz.com/edit/e1fre3-wnzfer?file=index.html

Tick Checkbox on Webpage using VBA

I am trying to automate one webpage based activity, where I need to select the Checkbox. There are multiple Checkbox available on the page and out of those, I need to select a particular one. I have tried many solutions provided on internet, but it gives me only one error as "object doesn't support this property or method". Below is the HTML code for the Checkbox. It would be really helpful if you revert with some VBA code to perform the Tick Checkbox action.
Also please let me know if any additional information is needed.
<input class="check" submitname="chkPropLinkId" type="checkbox" value="120633"></input>
I got the answer from different site. Below is the workable VBA code for the query,
Set elems = HTMLDoc.getElementsByClassName("check")
For Each e In elems
If (e.getAttribute("value") = "120633") Then
e.Click
Exit For
End If
Next e

Selenium, using xpath to click a button with a similar content

I want to click a button that contains "Add" as text.
ie:
driver.find_element_by_xpath("(//a[contains(text(),'Add')])").click()
however it's not practical to do this:
driver.find_element_by_xpath("(//a[contains(text(),'Add')])[1]").click()
It would be fine, except the page has a button with text "Add User", and it clicks that instead. Is there a way to only click it if it is EXACTLY "Add" and not just contains "Add"?
You can also try :
driver.find_element_by_link_text("Add").click()
link text will match links who's text equals Add and it doesn't match text which contains Add as part of it.
This should work for you:
driver.find_element_by_xpath("//a[text()='Add']").click()
You should change your xpath to require an exact match instead of a partial match.
driver.find_element_by_xpath("//a[text()='Add']").click()
Using text()= requires the text on the button to be equal to 'Add' and will not find other buttons that happen to contain the text 'Add'

VB.net prevent a tooltip from showing

In my program i use tooltips to help new users have some idea of what the icon buttons do. I also have an option to turn tooltips off.
There appears to be a tooltip.hide method, but i don't quite understand how to use it.
So how do i get a tooltip to not display if a boolean value is set to false.
Using the Active property should meet your needs, it's more simple than using the Hide and Show methods.
'Hide ToolTip
ToolTip.Active = False
'Show ToolTip
ToolTip.Active = True
tooltip.Hide() is used to hide the ToolTip while is being shown.
If you want the tooltips now showing you can put a condition when calling to the point that shows them:
If Not chkBoxNoToolTips.Checked Then
tooltip1.Show()
End If
Or you can remove the tooltips from its controls if they are automatically set:
tooltip1.SetToolTip(label1, "")
Call SetToolTip and pass through your control and an empty string, you could probably pass through a null reference also but I haven't tried it myself.
This should remove the tooltip for you
ToolTip1.SetToolTip(txtBox1, "")
Hope it helps