I am using Selenium with Excel VBA, and the website has been working well thus far, including pressing buttons. However, I have gotten to one that will not work no matter what I do. I will add some snippets of the code below.
This is one snippet that is a button click command that DOES work:
bot.FindElementById("btnSearch").Click
bot.Wait 1000
This is the HTML code for that button above on the respective website:
<button type="submit" id="btnSearch" class="btn wbx-btn-primary" ng-click="LoadPayorList()">Search</button>
This is the snippet of code that is having problems:
bot.FindElementById("btnEditContact").Click
bot.Wait 1000
This is the HTML code for the edit contact:
<button class="btn wbx-btn wbx-btn-primary ng-scope ng-isolate-scope" id="btnEditContact" ng-click="vm.setEditable(true)" ng-disabled="!vm.clientPermissions.hasAccessToMaintainClient" ng-if="vm.client.PAYOR_ID && !vm.isEditable" show="!vm.clientPermissions.hasAccessToMaintainClient" title="" type="button" wbx-clear-attribute="title"><span>Edit</span></button>
I have tried using CSS, Xpath, and Jscript and nothing seems to work, I appreciate any suggestions.
Alright I was able to solve it. Before, I was using the condensed Xpath and only the full xpath would work which I found by inspecting the element, right clicking, and taking the full x path. The correct snippet of code is below for anyone else who may have this issue in the future:
bot.FindElementByXPath("/html/body/div/div/div/div/div/div/div/div/div/client-attributes-tab/div/div/div/button").Click
bot.Wait 2000
Bookmarks