I'm having an issue with trying to click a hidden element in a Protractor test.
Below is the error message that is being returned, as well the code snippet that is causing the error message. Any idea as to why this error is being thrown would be greatly appreciated.
RangeError: Maximum call stack size exceeded
browser.driver.executeScript("return arguments[0].click()", bank_page.boaClick);
And "bank_page.boaClick()" is referenced as a variable on a page Object with the snippet seen below:
boaClick: { get: function () { return element.all(by.model('bankConnection.bank')).get(0); }},
And below is the snippet that I am attempting to reference with that variable:
<input type="radio" ng-model="bankConnection.bank" ng-value="bank" class="ng-valid ng-dirty" name="00D" value="[object Object]">
I basically just want to be able to click this radio button, but the button is a hidden element, so after searching online that first "browser.driver.executeScript" call seems to be the best option to achieve this, but I am getting the RangeError back since I have implemented it.
executeScript
does not take a page object. You need to pass in a raw web_element. (Protractor's element finder does not work either)
Try:
browser.driver.executeScript("return arguments[0].click()", bank_page.boaClick.get().getWebElement());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With