c# - element not visible Target invocation exception -
i trying automate login on dropbox https://www.dropbox.com/chooser ,but still facing issues element not visible, weird, though if page loaded successfully.
here code filling password:
protected virtual void fillpassword(string password) { //password.clear(); password.sendkeys(password); }
the last line fails on target invocation exception. wanted use password.clear();, failing.
here locator password:
[cachelookup, findsby(how = how.name, using = "login_password")] protected override iwebelement password { get; set; }
what going on? tried use wait methods page,but has not helped. know why crashes?
i changed html locator to:
[cachelookup, findsby(how = how.cssselector, using = ".text-input-wrapper [name=\"login_password\"]")] protected override iwebelement password { get; set; }
and works fine. not sure why name selector cannot find it. misunderstanding me. both approaches should work. here page source of field element:
<div class="text-input-wrapper"> <input id="pyxl14559" class="password-input text-input-input" type="password" name="login_password"> <label for="pyxl14559" style="">password</label> <small class="secondary-label"></small> <div class="password-caps-indicator">caps lock on</div> </div>
Comments
Post a Comment