Closed emanlove closed 5 years ago
It would also be helpful to have some documentation about the root selector and how one can find the root selector for the website they are testing.
This has been fixed in AngularJSLibrary release 0.0.10.
Hi Emanlove, I am using the latest version 0.10 but still hitting the same problem. Can you help me on how to get the root_selector any webpage ?
JavascriptException: Message: javascript error: Unable to find root selector using "[ng-app]". Please refer to the AngularJS library documentation for more information on how to resolve this error. (Session info: chrome=76.0.3809.100)
@uvelayut If is a public facing website and you can send the url I might be able to take a look.
@uvelayut If is a public facing website and you can send the url I might be able to take a look.
I am facing the same issue for this website https://angularjs.org/
Library AngularJSLibrary root_selector=[ng-app] JavascriptException: Message: javascript error: Unable to find root selector using "[ng-app]". Please refer to the AngularJS library documentation for more information on how to resolve this error.
Library AngularJSLibrary root_selector=[ng-version] JavascriptException: Message: javascript error: Unable to find root selector using "[ng-version]". Please refer to the AngularJS library documentation for more information on how to resolve this error.
@subanandhini It looks like the root_selector for https://angularjs.org is [ng-controller]
. Here is my test case
*** Settings ***
Library SeleniumLibrary
Library AngularJSLibrary root_selector=[ng-controller]
*** Variables ***
${LearnMenu} css:#navbar-main ul.nav li.dropdown:nth-of-type(1)
*** Test Cases ***
Try ng.org
Open Browser https://angularjs.org/ Firefox
Click Element ${LearnMenu}
`
I got this from the page source
<!doctype html>
<!-- ... -->
<head>
<!-- ... -->
<title>AngularJS — Superheroic JavaScript MVW Framework</title>
</head>
<body ng-controller="AppController" class="homepage">
<!-- ... -->
<header class="header">
<nav id="navbar-main" class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<h1 class="brand"><a href="https://angularjs.org"><img width="117" height="30" src="img/angularjs-for-header-only.svg" alt="AngularJS"></a></h1>
<!-- ... -->
From the \
element, using a css selector to describe the attribute of that element. In particular theng-controller
attribute.
The following robot script
results in the following error
The issue, as pointed out by Hélio Guilherme, is that the root selector is not the library default,
[ng-app]
, but instead the site clarity.design uses[ng-version]
. Thus the issue in the script above was solved by specifying the root on the library import, as inThe error message given is not at all helpful when it could be. The acceptance criteria is when the root locator is not found give a meaningful error.