Quality Testing

Quality is delighting customers

I need some help with finding the elements using webdriver. How do I find them???

  1. On the webpage this is the label 'Password'

< div _ngcontent-c1="" class="form-group text-left">

< label _ngcontent-c1="">Password

2.On the webpage this is the textbox for 'Password'

< input _ngcontent-c1="" class="form-control ng-untouched ng-pristine ng-invalid" formcontrolname="Password" placeholder="" type="password" autocomplete="off" style="background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAASCAYAAABSO15qAAAAAXNSR0IArs4c6QAAAXFJREFUOBGVVDGKwkAUfZHFaBBS2riQSrC18QJpAvbeYAVbD6DxFm4TELyA1R7BKmUgjRa7pAwELKKF2XljEuMSN/HDZOb//96b+X+GKLZtW0mSrMV4Rw1TFOVbwD6Wy+UX4Y1XyCSkG31yTaNArZ1v8Nu3yGkUE1VrTdPQ7/cfYC8JGIYB0zTLBVqtVp5QVRWiWblfzOXBdPHGeTweYzgcYrvdIgxDzGYzBEEAx3Eecn/J9F8qoUxAWSwWCRM8ZhzHEsMSzudzGT6PiRJ/hDPNT5CRiagiEyOusiemtewBA//ZZDLBYDDIIavVCtfrVYrUEmi324iiCPv9XoqQnFkjfduZXzpToNlsykdUJBNMgWmViO/78DwPuq7DsizwQWV2fy1ZJJ2z26Hb6XRwOp0wGo2kwG63g+u6ElmrB/P5XApQ6HK54HA4pNsATwV4z+lVYbPZoNvtys6zHDaURsxTAZFnb/ij6R2PR3AUjWRifgHmko6KAvVfRAAAAABJRU5ErkJggg=="); background-repeat: no-repeat; background-attachment: scroll; background-size: 16px 18px; background-position: 98% 50%;"/>

  1. On the webpage this is the button 'Login'

< div _ngcontent-c1="" class="text-right col-xs-4 col-sm-4 col-md-4 login-submit no-side-padding"> Login< /button >

Views: 29

Reply to This

Replies to This Discussion

There are multiple ways of locating elements at the page, since we cannot see the code the answers will assume XPath locators as it's the most powerful (on the other hand it might be the slowest one)

  1. //label[text()='Password']
  2. //input[@type='password']
  3. //button[text()='Login']

References:

Otherway:

//input[@formcontrolname='Password']

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2019   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service