I lost two days trying to solve this problem by myself, but I give up. pleaseee help .
i want to load my tree using jstree and promise AngularJS
but I keep getting this error:
Uncaught Neither data nor ajax settings supplied.
i can see im my html page jsut the pluging loading and no result :(
y'll find in thi link my code .
http://plnkr.co/edit/kDjFCa4x6Ghyb3pwghXc?p=preview
Thank you very much :)
After some playing with your code, I got this: http://plnkr.co/edit/JfTVNdQnaGZV01wyQHtn
changes: third argument of scope.$watch to true, setting "json_data" to
"json_data" :{
"data":scope.jstree.data
}
(looks strange, but it's quirks of jsTree)
Related
I have a project made with react and rest api(php+mysql).I have to put it through a codeceptjs test.The app is working properly with countless of manual testing, and as far as I can see, the codeceptjs test is working too, but it gives the following error:
Error: Clickable element "ADD" was not found by text|CSS|XPath
at new ElementNotFound (node_modules/codeceptjs/lib/helper/errors/ElementNotFound.js:14:11)
at assertElementExists (node_modules/codeceptjs/lib/helper/WebDriver.js:2835:11)
at WebDriver.click (node_modules/codeceptjs/lib/helper/WebDriver.js:917:7)
at processTicksAndRejections (internal/process/task_queues.js:97:5)I }) => {
I.amOnPage('/');
I.click('ADD');
I.seeElement('#product_form');
I.fillField('#sku', 'SKUTest000');
I.fillField('#name', 'NameTest000');
I.fillField('#price', '25');
I.waitForElement('#productType');
I.selectOption('#productType','DVD');
I.waitForElement('#size');
I.fillField('#size','200');
I.click('Save');
My add element looks like this:
<Link title="ADD" to="/add-product">ADD</Link>
Can someone please help me out why is this error appearing and how can I solve it? Thanks in advance!
Update:
I did a couple more tests, and I noticed that sometimes it gives back less/different errors depending on the test's time. For example:
http://165.227.98.170/open?testName=ed
http://165.227.98.170/open?testName=ah
http://165.227.98.170/open?testName=bc
My guess is that is has to do with how react loads in the html elements and manages the rest api calls. How/what should I change in the app to accomodate the test script?
Seems like the problem was I put the whole home page's load after the rest api call by accident.
I use the following code snippet to show a simple modal:
$modal({
title: 'My Title',
template: 'path/to/my/simple.modal.html',
show: true,
scope: $scope
});
After closing the modal some parts of my webpage do not react to any events. In all other browsers this is working fine.
It's also really strange that I am not able to inspect some of the elements after closing the modal, all elements are shown as one single element (when using the Inspector-Tools in IE). After found one inspectable item, all the other items are getting inspectable as well. After inspecting for some moments, there is no freezed part again ... it's a really strange behaviour.
Does anybody else have this behaviour ?
I am using Angular 1.5 and Angular-Strap 2.3.7.
Thanks in advance !
Sad, that there were no further hints on this.
I looked in the angular-strap bug-list for a solution and found one :
Just call $destroy(); after hiding the modal did the trick for me.
Best !
I Know this question is answered. but this is for share some info on that same issue.
Recently I also came across with that issue. In my case the reason was a CSS attribute Display:block. So after I turn the value from block to none my freezing error went off and it worked like a charm. So first right after you get that error check in Inspection whether the resulting div where the modal is loaded has a style = "Display:block" in it. If so remove it by a script or etc.
Hope this will help to improve this question.
After a lot of research, and tinkering, I can't seem to actually get my Protractor test to do anything else other than have an Angular related error, even though I am using browser to avoid Angular being detected at all.
The test involves an Angular app, opening a dropdown in it, and clicking on the link for the console; the console opens a non-Angular admin page in a separate window.
So based on the many informative SO posts I found, I first used this...
browser.driver.getAllWindowHandles().then(function(handles) {
browser.driver.switchTo().window(handles[1]).then(function() {
//expect for new window here
});
});
Which appeared to work, as I could get to the window through repl pretty easily.
The issue is when either of the following were added...
browser.driver.getAllWindowHandles().then(function(handles) {
browser.driver.switchTo().window(handles[1]).then(function() {
expect(browser.getLocationAbsUrl()).toContain('/console/login.jsp');
expect(browser.driver.findElement(By.css('th.login')).getText()).toEqual('Login');
});
});
One expect check the URL and the other checks for the header element on the page, which is a table header. When I run this, I get the following:
Error while waiting for Protractor to sync with the page: "angular could not be found on the window"
When I decide to use browser.ignoreSynchronization = true, both in the function, or in a beforeEach, with or without a following afterEach setting it to false, I get the following:
JavascriptError: angular is not defined
I can't seem to get any "useful" errors to help me debug it, and trying it in repl does not help, as I get the same issue.
To be comprehensive, trying my URL expect without getting the second window will give me the root, and the other will fail.
Just doing one or the other will cause the same problem.
Changing to regular syntax (element(by.css...)) does not change things.
So much for my first question...
It appears that my use of browser.getLocationAbsUrl() is meant to be used for an Angular page, and was causing my issue...
Essentially, even though I believed I was using pure Webdriver calls, that call still required Angular on the page to work...
As stated in another post, the use of browser.driver.getCurrentUrl() is a non-Angular call using Webdriver, and fixed the problem. Thus, the final code is the following...
browser.sleep(1000); //to wait for the page to load
browser.driver.getAllWindowHandles().then(function(handles) {
browser.driver.switchTo().window(handles[1]).then(function() {
expect(browser.driver.getCurrentUrl()).toContain('/console/login.jsp');
expect(browser.driver.findElement(By.css('th.login')).getText()).toEqual('Login');
});
});
This works without setting ignoreSynchronization, BTW.
I realized it would probably be something relatively simple to fix it, just didn't expect I'd get it that quickly (I intended on submitting the question last night, but posted it this morning instead).
In any case, I hope this will at least be a good reference for anyone else facing the same issue.
Seems like getLocationAbsUrl is angular abs url.
Try using the native driver getCurrentUrl instead.
-- expect(browser.getLocationAbsUrl()).toContain('/console/login.jsp');
++ expect(browser.driver.getCurrentUrl() ...
Been trying to get my own autocomplete plugin to work as an Angular directive
Hopefully this is a straightforward one, please let me know if I'm barking up the wrong tree with this.
So I have a jquery autocomplete plugin that I wrote myself, just trying to hook it up in Angular as a directive, purely to have a play with my own directives.
The bit I'm struggling with is passing the content of the text box to the api endpoint. If you look in the demo and in the console, you'll see it is passing undefined across each time (line 133 and 173 in jsfiddle).
scope.testAutocomplete = new AA('Test', element,{
dataType: 'json',
jsonPath: 'http://apiendpoint.com?query=' + scope.searchTerm + '&apikey=1234&limit=5'
The 'watch' inside the directive updates correctly, but it passes 'undefined' to the endpoint.
apologies for the fiddle, Plunkr just won't save for some reason.
http://fiddle.jshell.net/PxHC3/7/show/
http://jsfiddle.net/PxHC3/7/
So before I even get to passing info into scopes and such, I'm just wondering if I'm on the right path.
Cheers
Tom
How can i solve object error in ie7. Once i load my page. ie7 shows [object Error] in an alert box. i want to know why it happens and how to solve this.
(EDIT) this just in:
It now seems that IE7 sometimes displays this popup when an error occurs. It almost looks like it's trying to display an alert() with an object in it, called error. Here's how I found out. I was trying to set a table row's CSS display attribute to table-row, but after some debugging and internet seaching, I found out that IE7 and earlier do not support table-row as a display value. What I had:
document.getElementById('writeoff_tablerow').style.display = 'table-row';
What solved the problem:
try {
document.getElementById('writeoff_tablerow').style.display = 'table-row';
}
catch(e) {
document.getElementById('writeoff_tablerow').style.display = 'block';
}
(EARLIER ANSWER)
I've been stumped with this same thing today. Ultimately, the cause of the problem boiled down to the fact that I was using document.body.addEventListener to make the page respond to a mouse click:
document.body.addEventListener('click',function(){document.getElementById('blah_div_id').style.display='none';},false);
When I changed the code to the following, the problem was gone in IE7:
document.body.onclick=function(){document.getElementById('blah_div_id').style.display='none';};
post some code, otherwise we cant help you.
try the website in Firefox with Firebug installed, and maybe you will get additional information in the console there (if the problem is in FF as well, that is)
Since i am using Protovis Graph library. This is cause for my error. Since Protovis is not compactable with ie7 it araise object error.