0
<div class="popover-content">
<div class="">  
            <article class="  col-sm-2 nav-color login">
                <form class="form-nav-login" title="form-nav-login" action="/" method="post">

                    <div class="input-field alt">
                        <input name="email" title="email" class="email" required="" type="text">
                        <label>Username</label>
                        <span class="bar"></span>
                        <span class="error-message">Required</span> 
                    </div>

                    <div class="input-field alt">
                        <input title="password" name="password" class="password" required="" type="password">
                        <label>Password</label>
                        <span class="bar"></span>
                        <span class="error-message">Required</span>
                    </div>

                    <button type="submit" class="button primary regular btn-block login-btn">Log In</button>

                    <p class="smallest forgot-username text-center">
                        Forgot</p> <p><a href="/spa/#/login/forgot-username" role="button" class="text-link">Username</a> or <a href="/us/home-reference" role="button" class="text-link">Password </a>?</p>

                    ****<a href="/spa/#/account" class="button secondary-alt btn-block signup-btn" role="button">Sign up</a>****
                </form>
            </article>

    </div></div>

I have tried below css for the Bold source line:

  1. element(by.cssContainingText('a', 'Sign up'))
  2. element(by.css('[href="/spa/#/account"]'))
  3. element(by.css('.signup-btn'))
  4. element(by.css('.button.secondary-alt.btn-block.signup-btn'))

None of these css and protractor expected conditions works for this. Here is the image:

SignUp

This is kind of tray. once i click on SIGN UP/LOGIN. This tray will pop up. And i have to click on Sign Up.

In the background, pictures are sliding after every 2 seconds.

  • Your selectors are correct except the last one ..it should be `.button.secondary-alt.btn-block.signup-btn`. What error are you seeing .. – AdityaReddy Mar 20 '17 at 14:05
  • This is the error I am getting: Message: Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL. onTimeout (\..\..Protractor\node_modules\jasmine\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1812:23) Message: Failed: element not visible –  Mar 20 '17 at 14:23
  • Do you have any animations or loading delay for that element? Maybe make Protractor wait for that element to be displayed. I use a helper function as per my answer for this. Use `isDisplayed()` instead of `isPresent()`: http://stackoverflow.com/questions/42902624/intermittently-failing-tests-with-protractor-promise-order-execution/42903087#42903087 – preeve Mar 20 '17 at 14:30

1 Answers1

0

Looks like your element is a "forgotPassword" link and I am not sure if its visible by default or you need to perform some action. But try the below code and check ..

var EC = protractor.ExpectedConditions;
browser.wait(EC.visibilityOf(element(by.cssContainingText('a', 'Sign up'))), 5000);
element(by.cssContainingText('a', 'Sign up')).click()
AdityaReddy
  • 3,625
  • 12
  • 25