tag:support.arachni-scanner.com,2012-07-01:/discussions/questions/12946-angularjs-watir-not-locating-elements-on-login-formArachni: Discussion 2016-11-28T15:26:40Ztag:support.arachni-scanner.com,2012-07-01:Comment/405231432016-08-11T21:28:47Z2016-08-13T07:43:56ZAngularJS - Watir not locating elements on login form<div><p>Hello Tasos!</p>
<p>We have an app that uses AngularJS and the login script can't
find the username (id=username) and password (id=password),</p>
<p>Login form:</p>
<pre>
<code><form class="ng-pristine ng-valid" autocomplete="false">
<div class="form-group has-feedback">
<label class="control-label" for="cpf">Usuário</label>
<div class="input-group">
<span class="input-group-addon">
<span class="fa fa-user"></span>
</span>
<input id="username" class="form-control ng-pristine ng-valid ng-empty ng-touched" type="text" submit="" uk-model-update-on="" autocomplete="false" mask-clean="true" mask-restrict="reject" mask="999.999.999-99" ng-model="vm.autenticacao.userName" placeholder="000.000.000-00" autofocus="" style="">
</div>
<span class="fa form-control-feedback" aria-hidden="true"></span>
</div>
<div class="form-group has-feedback">
<label class="control-label" for="senha">Senha</label>
<div class="input-group">
<span class="input-group-addon">
<input id="password" class="form-control ng-pristine ng-valid ng-empty ng-touched" type="password" submit="" uk-model-update-on="" autocomplete="nope" ng-model="vm.autenticacao.password" style="">
</div>
<span class="fa form-control-feedback" aria-hidden="true"></span>
<div class="text-right">
</div>
<div class="form-group has-feedback">
<div class="form-group has-feedback">
<div class="form-group">
<button class="btn btn-primary btn-block center-block" ng-click="vm.entrar()" uk-submit="" type="submit">
<span class="fa fa-arrow-right right"></span>
Entrar
</button>
</div>
</form></code>
</pre>
<p>Login script:</p>
<pre>
<code>browser.goto 'http://URLAPP'
sleep(15)
browser.text_field(:id => "password").send_keys 'password@!#'
browser.element(:xpath => "//*[text()='entrar']").click
sleep(15)
framework.options.session.check_url = 'http://URL_check'
framework.options.session.check_pattern = /Bem vindo/</code>
</pre>
<p>error msg:</p>
<pre>
<code>Session: [Watir::Exception::UnknownObjectException] unable to locate element, using {:id=>"username"...</code>
</pre>
<p>I tried id, xpath, css and still not finding the elements.</p>
<p>Thanks in advance</p></div>Silvio Correiatag:support.arachni-scanner.com,2012-07-01:Comment/405231432016-08-11T21:33:00Z2016-08-11T21:33:11ZAngularJS - Watir not locating elements on login form<div><p>html code attached...</p></div>Silvio Correiatag:support.arachni-scanner.com,2012-07-01:Comment/405231432016-08-13T07:52:44Z2016-08-13T07:52:44ZAngularJS - Watir not locating elements on login form<div><p>Are you sure that the error corresponds to that login
script?<br>
I don't see anything being located via a username id.</p></div>Tasos Laskostag:support.arachni-scanner.com,2012-07-01:Comment/405231432016-08-13T07:53:25Z2016-08-13T07:53:25ZAngularJS - Watir not locating elements on login form<div><p>Also, I'm going to need the full error please.</p></div>Tasos Laskostag:support.arachni-scanner.com,2012-07-01:Comment/405231432016-08-19T17:21:46Z2016-08-19T17:21:47ZAngularJS - Watir not locating elements on login form<div><p>Ok. I'll send.</p></div>Silvio Correiatag:support.arachni-scanner.com,2012-07-01:Comment/405231432016-08-22T15:37:08Z2016-08-22T15:37:08ZAngularJS - Watir not locating elements on login form<div><p>Any further updates on this issue?</p></div>Franktag:support.arachni-scanner.com,2012-07-01:Comment/405231432016-08-22T15:47:03Z2016-08-22T15:47:03ZAngularJS - Watir not locating elements on login form<div><p>It's almost impossible to debug this without access to the
application, although it could be a browser incompatibility with
AngularJS -- in which case you'll need to wait for the <a href="https://github.com/Arachni/arachni/issues/764">upgrade</a>.</p></div>Tasos Laskostag:support.arachni-scanner.com,2012-07-01:Comment/405231432016-08-22T17:53:58Z2016-08-22T17:53:58ZAngularJS - Watir not locating elements on login form<div><p>I asked because I ran into a similar issue with Arachni's use of
PhantomJS 1.9.2 and compatibility with AngularJS 2.</p></div>Franktag:support.arachni-scanner.com,2012-07-01:Comment/405231432016-08-24T12:18:41Z2016-08-24T12:18:41ZAngularJS - Watir not locating elements on login form<div><p>Please subscribe to this issue to monitor the upgrade progress:
<a href="https://github.com/Arachni/arachni/issues/764">https://github.com/Arachni/arachni/issues/764</a></p></div>Tasos Laskostag:support.arachni-scanner.com,2012-07-01:Comment/405231432016-08-26T09:07:11Z2016-08-26T09:07:11ZAngularJS - Watir not locating elements on login form<div><p><a href="http://downloads.arachni-scanner.com/nightlies/">Nightlies</a>
with PhanomJS 2.1.1 are up.</p>
<p>Give them a try and let me know how they do.</p></div>Tasos Laskostag:support.arachni-scanner.com,2012-07-01:Comment/405231432016-09-21T18:54:10Z2016-09-21T18:54:13ZAngularJS - Watir not locating elements on login form<div><p>Hi Tasos,</p>
<p>I'm still having issues with angularJS. Can I send you my logs
privately? This is verry important to solve, because we are
planning to replace Hp webinspect to Arachni. Thanks a lot for your
help.</p></div>Silvio Correiatag:support.arachni-scanner.com,2012-07-01:Comment/405231432016-09-21T21:43:27Z2016-09-21T21:43:27ZAngularJS - Watir not locating elements on login form<div><p>I'd love a chance to debug this but I can't do it via logs, I'm
afraid I'm going to need access to the webapp.</p></div>Tasos Laskostag:support.arachni-scanner.com,2012-07-01:Comment/405231432016-09-21T23:34:10Z2016-09-21T23:34:11ZAngularJS - Watir not locating elements on login form<div><p>I'm sorry but it's not possible to access the webapp. Because,
it's protected app by the Brazilian gov. Thanks for your hey</p>
<p>Thanks for your support</p></div>Silvio Correiatag:support.arachni-scanner.com,2012-07-01:Comment/405231432016-09-23T11:47:29Z2016-09-23T11:47:29ZAngularJS - Watir not locating elements on login form<div><p>Any chance you can setup a demo that's identical to how the page
behaves?</p></div>Tasos Laskostag:support.arachni-scanner.com,2012-07-01:Comment/405231432016-11-28T15:26:40Z2016-11-28T15:26:40ZAngularJS - Watir not locating elements on login form<div><p>Closing due to lack of feedback, please re-open if you want to
add more information.</p></div>Tasos Laskos