0

In Angular JS, there is an option to set and get the controller variables via protractor using "Evaluate()" function like in the below example,

> element.all(by.repeater("address in addresses")).filter(function (ele)
> {
>      return ele.evaluate("address.zipCode").then(function (zipCode) {
>           return zipCode === "10801";
>      }); });

Same is there any way to access the component variables in Angular > 2 versions using protractor.

  • What is the use case here? What are you trying to achieve? – Vishal Aggarwal Jun 4 at 2:10
  • So by accessing or modifying the component variables, I dont need to put much effort to select something in the UI. In our application I have to interact more with the UI like drag and selection etc. So it is better to change the componenet variables instead of taking css locators and doing actions. This is how we were doing in Angular JS. you can refer this, same I am trying to do in Angular 7 , stackoverflow.com/questions/20619225/… – dhivagar r Jun 5 at 1:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.