I have the class
.el-button{&_radius(#color){...}}
to use in other classes for example:
.block{.el-button_radius(#green)}
but parser retrieve error: "Missing closing ')'"
if i use it without parent selector - &
.el-button_radius(#color){...}
it is good
is it possible?
Related
I am working with MRJob through python and when I try to create a class, I get a synthax error. It's highlighting the colon. What am I missing? Here is my code:
class Bacon_count(MRJob):
You are defining an empty class, but in an unproper way. In Python an empty class should contain a pass statement, in your case:
class Bacon_count(MRJob):
pass
Also, take into account how to define single class methods in multiple cells, if that's what you are trying to do, as it is discussed here.
different ways I used to click on that element are,
driver.findElement(By.xpath(".//*[#value=.,"+NewStateName+"]")).click();
driver.findElement(By.cssSelector(".//*[#value=.,'"+NewStateName+"']")).click();
driver.findElement(By.value(NewStateName));
driver.findElement(By.linkText(NewStateName));
driver.findElement(By.xpath("//span[contains(.,"+NewStateName+")]"));
In above code 'NewStstaeName is a string variable for which the value is dynamically generated during run time.
Error returned:
org.openqa.selenium.InvalidSelectorException: The given selector .//*[#value=.,NEWSTATEABC21M] is either invalid or does not result in a WebElement. The following error occurred:
I think you'll need quotes around the value of NewStateName, try these:
driver.findElement(By.xpath(".//*[#value=.,'"+NewStateName+"']")).click();
driver.findElement(By.xpath("//span[contains(.,'"+NewStateName+"')]"));
The resulting selector will then look like:
.//*[#value=.,'NEWSTATEABC21M']
I get the following compilation error in Monodevelop:
Error CS0121: The call is ambiguous between the following methods or properties:
'System.Linq.Enumerable.ToArray<AudioBitrateCalculationStream>(this System.Collections.Generic.IEnumerable<AudioBitrateCalculationStream>)' and
'System.Linq.Enumerable.ToArray<AudioBitrateCalculationStream>(this System.Collections.Generic.IEnumerable<AudioBitrateCalculationStream>)' (CS0121)
Both definitions are exactly the same. I cannot understand what the issue is. Internet search does not help.
I would like to call an object method dynamically.
The variable "MethodWanted" contains the method I want to execute, the variable "ObjectToApply" contains the object.
My code so far is:
MethodWanted=".children()"
print eval(str(ObjectToApply)+MethodWanted)
But I get the following error:
exception executing script
File "<string>", line 1
<pos 164243664 childIndex: 6 lvl: 5>.children()
^
SyntaxError: invalid syntax
I also tried without str() wrapping the object, but then I get a "cant use + with str and object types" error.
When not dynamically, I can just execute this code to get the desired result:
ObjectToApply.children()
How to do that dynamically?
Methods are just attributes, so use getattr() to retrieve one dynamically:
MethodWanted = 'children'
getattr(ObjectToApply, MethodWanted)()
Note that the method name is children, not .children(). Don't confuse syntax with the name here. getattr() returns just the method object, you still need to call it (jusing ()).
I want to pars my xml file in objective-c, but I got an error
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason:
'[<Presentation1Name 0x74592f0> setValue:forUndefinedKey:]: this class is not key value
coding-compliant for the key slide.'
*** First throw call stack:
(0x1c93012 0x10d0e7e 0x1d1bfb1 0xb7d711 0xafeec8 0xafe9b7 0x5129 0xbb11c7 0x48c65ee
0x48c5f07 0xbaf6d2 0x2008 0x157b7 0x15da7 0x16fab 0x28315 0x2924b 0x1acf8 0x1beedf9
0x1beead0 0x1c08bf5 0x1c08962 0x1c39bb6 0x1c38f44 0x1c38e1b 0x167da 0x1865c 0x1e5d
0x1d85)
libc++abi.dylib: terminate called throwing an exception
(lldb)
ment to lowercase presentation , I don"t have an error bu I can not pars the label="presentation1" but when I change it to Upercase P -> Presentation I can pars it but with terminated process
Would you please give me some hint for finding the problem?
aPresentation is your own class so its hard to know exactly what its made up of. However your error is coming up when you try to do (unless there is more code that your not showing) :
[aPresentation setValue:currentElementValue forKey:elementName];
here you are saying you have a property in the object aPresentation with the name elementName; specifically your error is saying there is no property with the name "slide"
Is there a property (variable) with the name "slide"? Apparently not.
I would suggest hard coding what the elementName is because apparently they are not lining up with your class.
According to the xml your property (within aPresentation) should be named "slides" so either rename the property in your class to slides or just change element name into what you know it to be.
[aPresentation setValue:currentElementValue forKey:#"slideLabel"];
some of this is guess work without seeing the class structure of Presentation1Name
I would also like to point out some conventions you are not following which makes this code very hard to read. Property names should be capitalized (first letter), including numbers in your class names is ok but not used very often and probably not needed in this case. you are checking if the elementName is Slides or slide and really that stuff shouldnt change and you should be able to remove one of those statements. i would also recommend to always use brackets, some of your else statments dont