Capture hidden Protractor element RangeError: Maximum Call Stack Size Exceeded

I had a problem trying to click on a hidden element in a Protractor test.

The following is an error message, as well as a piece of code that causes an error message. Any idea of ​​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 the Object page with the following snippet:

  boaClick: { get: function () { return element.all(by.model('bankConnection.bank')).get(0); }}, 

And below is the snippet I'm trying to reference this variable:

 <input type="radio" ng-model="bankConnection.bank" ng-value="bank" class="ng-valid ng-dirty" name="00D" value="[object Object]"> 

I just want to be able to click this switch, but the button is a hidden element, so after searching the Internet, the first call to “browser.driver.executeScript” seems to be the best option to achieve this, but I get RangeError since I implemented it.

+5
source share
1 answer

executeScript does not accept the page object. You need to pass raw web_element. (The crawler element finder does not work)

Try:

 browser.driver.executeScript("return arguments[0].click()", bank_page.boaClick.get().getWebElement()); 
+6
source

Source: https://habr.com/ru/post/1211994/


All Articles