0

I am trying to automate login on DropBox https://www.dropbox.com/chooser ,but still facing issues with element not visible, which is weird, even though if the all page is loaded successfully.

Here is the code for filling the password:

   protected virtual void FillPassword(string password)
    {
        //Password.Clear();
        Password.SendKeys(password);
    }

The last line fails on the Target Invocation Exception. I also wanted to use Password.Clear();, but this was also failing.

Here is the locator for Password:

[CacheLookup, FindsBy(How = How.Name, Using = "login_password")]
protected override IWebElement Password { get; set; }

What is going on? I tried to use wait methods for the page,but it has not helped. Does anyone know why it crashes?

Michal
  • 610
  • 10
  • 24
  • Can you confirm whether the *Password box* is visible when you do the *SendKeys()* – bit Apr 19 '16 at 08:28
  • I suggest,if the page is displayed and some time spends, it is obvious that page is fully loaded. At least I relied on this rule ever. It is true,that when I used WebDriverWait, it ended with Timeout,that element was not found. This is confusing me, beacause webdriver.page source displayed it... – Michal Apr 19 '16 at 09:01

1 Answers1

1

I changed the HTML locator to:

[CacheLookup, FindsBy(How = How.CssSelector, Using = ".text-input-wrapper    [name=\"login_password\"]")]
protected override IWebElement Password { get; set; }

and this works fine. I am not sure why the name selector cannot find it. This is misunderstanding to me. Both approaches should work. Here is the page source of the 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 is currently on</div>
</div>
Michal
  • 610
  • 10
  • 24