Cannot read property 'findElementsOverride' of undefined - jasmine

Protractor/jamine error message:
Failed: Cannot read property 'findElementsOverride' of undefined
any clue on whats causing this error message?

More details would have helped.At-least what caused the error:)
But I have faced this issue before and you will see this when using isElementPresent() in scenarios like below
expect(body.isElementPresent()).toBeTruthy();
The problem is that isElementPresent() is checks based on subLocator and doesnt accept null as argument
The docs state the proper way of using it
This checks whether the element identified by the subLocator is
present, rather than the current element finder
element(by.css('#abc')).isElementPresent(by.css('#def')).

Related

OpenLayers can't get feature by key, undefined error

I am trying to get some key values from features in extent but I am unable to.
I tried to look up ID [feature.getId()] which works totally fine, see here:
If I try feature.get('id') it's undefined for some reason. (And it's undefined for every key I am trying to get by name)
I tried feature.getKeys() and it's returning geometry,info,index,popup.
I stored every info I need under info key.
I tried to get data in console and I can see that a point has 'id' key, and I am unable to get it with feature.get('id')
Does anyone know what am I doing wrong?
I had to access values with Object.values method.
Object.values(Object.values(feature.get("info"))[0][2])[1]

PyCharm debugger doesn't show objects' content: "Unable to get repr for <type 'list>"

Debugging with PyCharm (happens on multiple versions) I'm unable to correctly view some lists and dictionaries (other are presented correctly).
In the view window the object's name is presented with the message:
{list} Unable to get repr for <type 'list>
or
{dict} Unable to get repr for <type 'dict'>
An update:
In one of my attempts, I received the following message from the debugger (presented instead of the value of one of the list variable):
Unable to display children:Error resolving variables Traceback (most
recent call last): File "/Applications/PyCharm
CE.app/Contents/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line
1004, in do_it
_typeName, valDict = pydevd_vars.resolve_compound_variable(self.thread_id, self.frame_id,
self.scope, self.attributes) TypeError: 'NoneType' object is not
iterable
I'll appreciate any idea as for what may cause this behavior?
Thanks!
It turned out the problem is due to usage of rpyc.py: The process I was debugging was called through rpyc and while I was debugging it, the calling process received a timeout on the rpyc connection.
I think that this caused variables, passed through rpc to lose integrity so the debugger couldn't present them correctly.
The solution was to downgrade rpyc.py to version 3.3.0 (I was on 3.4.2).
My colleague, Nurit Izraelov, correctly suggested the rpyc.py version may be the blame.
Thanks all!
It happened to me sometimes and what caused the behaviour was that some MyClass triggered an exception on its str method.
In such a case, PyCharm debugger only showed
some_object = {MyClass} Unable to get repr for <class 'my_app.models.MyClass'>
So what I did to confirm the origin was to watch repr(some_object) in the Watches section of the debugger. And there it gave me an explicit error message:
{TypeError}%d format: a number is required, not NoneType
Which helped me trace back to the origin.
I appreciate this is not a generic answer, but just a complement to Fabio's.
Probably some custom class of yours has a bad __repr__ or __str__ in it and the debugger is unable to print it.
You can probably use a shell at that point to know which elements are actually inside such a dict or list (and see which object has the faulty __repr__ or __str__).
Extending the scope of the problem rather than adding an answer - all the other suggestions are what I do normally to get this working.
Could it be a race condition?
For me it appears to be something weird. In the Variables pane I can see correct representation for theObject, repr(theObject) and even [theObject] but if I set a variable in my code thus a = theObject or b = [theObject] then I get the "Unable to get repr for <class 'list'>" message.
theObject in this case is an instance of a subclassed D lang struct wrapped with autowrap.

Check if property exists in object

I spent a long time now trying to figure this myself with the help of other questions but failed so I REALLY need to ask this again
I have the following object in ruby
(...)
:follow_request_sent:
:notifications:
:coordinates:
:place:
:contributors:
:favorite_count: 0
:entities:
:hashtags:
- :text:
:indices:
(...)
This is object X. What I want to do is check if x.place exists. I've tried barely EVERYTHING. any, ?, include?, with [hash], defined?, (...) but it ALWAYS throws an error "undefined method" when trying to access the property, whether it exists or not. It NEVER works and I don't understand why. This is twitter API btw. Does anyone imagine why? Please do not point me to another answers because basically they all failed.
If you want to see if there is such a method:
x.respond_to?(:place)
If you want to see if there is an instance variable:
x.instance_variable_defined?(:#place)

Capybara debug, don't even know where has this error

I am debugging, then the error message pop up like following:
http://127.0.0.1:56121/apps/quicktip/quicktip_model.js|84|=============================checkShownBefore
Started request to "http://127.0.0.1:56121/apps/quicktip/ejs/quicktip.ejs"
Received 200 from "http://127.0.0.1:56121/apps/quicktip/ejs/quicktip.ejs"
http://127.0.0.1:56121/apps/quicktip/quicktip_model.js|31|=============_setTip
http://127.0.0.1:56121/apps/quicktip/quicktip_controller.js|153|======================currentTip
http://127.0.0.1:56121/apps/quicktip/quicktip_controller.js|153|==============finish currentTip
http://127.0.0.1:56121/apps/quicktip/quicktip_model.js|31|=============_setTip
http://127.0.0.1:56121/apps/quicktip/quicktip_controller.js|153|======================currentTip
http://127.0.0.1:56121/apps/quicktip/quicktip_controller.js|153|==============finish currentTip
undefined|0|TypeError: 'undefined' is not a function
It didn't even mention which file is complaining the type error, I tried to use console.log in quicktip_controller.js, to see whether there is anything wrong after this page. But I can get nothing. Any suggestion??
Suggestion is that the undefined is valid in js, but invalid for pure rails environment. So you haveto look into apps/quicktip/ejs/quicktip.ejs or around files for the occurines of undefined keyword in ruby code.

Splunk-client (with Nokogiri) giving Undefined Namespace Prefix

I'm using splunk-client to extract results from splunk. Here's the code:
query = "sourcetype=collection #{order_id}"
search = #splunk_client.search(query)
search.wait
The search is happening fine, and it seems like I'm doing everything according to the example (https://github.com/cbrito/splunk-client), but I get this error on the 'search.wait' line:
Undefined namespace prefix: //s:key[#name='isDone']
Any ideas what could be going wrong? Running these commands in irb works fine. Is there some sort of blocking issue?
There is currently very little error checking which occurs within the gem itself. The reason for the error is that wait looks for the status of the isDone key to change to true.
Since your credentials were not properly setup in the first place, the gem creates a search object with an invalid session. The search does not initially fail, because enough response came back from Splunk that Nokogiri processes it into an object without a Splunk search sid.
In the future I should likely raise an exception if a proper sid is not returned to avoid confusion.
Source: I wrote the gem.
I found out the issue -- the splunk client wasn't authenticating properly, and so search was actually a broken SplunkJob object (with a nil username and authentication key). It's strange that there was no error raised until the wait command, but upon inspecting the search object, one of the fields stated that the object was malformed.

Resources