This is a migrated thread and some comments may be shown as answers.

Button does not click (AngularJS)

1 Answer 85 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 24 Jul 2014, 02:15 AM
Hi,

I have a web site that user AngularJS but having a problem getting a button clicked;

The problem here is that I can find the element with id X and does not through any errors clicking on the elment.

My Code:


Console.WriteLine(name + ":Finding Button: " + id);
                var element = myManager.ActiveBrowser.Find.ById(id);
                if (element == null)
                {
                    Console.WriteLine(name + ":Input not found");
                    return false;
                }

                myManager.ActiveBrowser.WaitUntilReady();
                Console.WriteLine(name +":Button Found, clicking on it!");
                myManager.ActiveBrowser.Actions.Click(element);





Nothing happens, no errors etc, below is the html:
  <form role="form"  id="LoginForm" name="LoginForm">
                <input type="text" class="col-xs-6 form-control" id="userName" placeholder="Username" title="Username" ng-model="Login.Model.Username" required local="Username"/>
                <input type="password" class="  col-xs-6 form-control" id="Password" placeholder="Password" title="Password" ng-model="Login.Model.Password" required local="Password">
                <button type="submit" id="Submit" class="btn btn-red col-md-12" ng-click="Login.Login(LoginForm.$invalid)" local="Login">Login</button>
                <p class="text-center"><a href="#NewApplication" class="register-link" local="Register">Register</a></p>
                
                    <select langbar></select>
                
            </form>




Any help would be great.

Thanks
Paul.

1 Answer, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 28 Jul 2014, 11:59 AM
Hi Paul,

Thank you for contacting us.

Unfortunately I am not able to reproduce the issue. I executed your code and everything worked as expected.

I have modified it slightly.

1. Remove Return false from the IF block.

2. Add Else block which will contain the click step.

Give that a try and let us know the result.

Hope to hear from you soon.

Regards,
Boyan Boev
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Paul
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Share this question
or