How do I assert a 'specific' element attribute value with Selenium IDE? - attributes

Problem: I can't figure out how to assert an captured value (Store Attribute) to the expected value.
What I'm trying to do: I'm still learning Selenium IDE. I figured out how to use Store Attribute to capture an Elements Style attribute and can Echo the variable to make sure I did indeed capture it. Now I want to compare (verify or assert) the value in the captured variable is equal to the expected value.
What I have tried: I've tried Assert Text, Assert Value, and have targetted the element attribute directly in the same way I captured it, then using the Value field for the expected value (like you would do asserting an "invalid" message. That seems to fail though. I've targeted the variable ${highligh} in the same way and it failed as well. So I'm not sure exactly how to verify/assert an attribute value.
In the images below, I've also tried Assert Text on the first and Assert Value on the second with Targets and Values remaining the same I just didn't capture the images.

After looking further for an answer here (StackOverflow) and elsewhere, just using the assert command as follows worked for me:
assert | <variable> (w/o ${}) | <expected-value>

Related

How to get null value in azure expression

I created a derived column in ADF using dynamic content as
iif(instr({userID},'_') > 0,toInteger(split({userID},'_')[2]),0) but I am unable to set it to default null instead of 0.
Above I am splitting all the digits after '_' and setting them as my output. But if there is no underscore then it should return a null.
Example 1:
Input 2jifh-ndifh3-idhf37-2323sd_445589
Output 445589
Example 2:
Input mkla4-5gj79a-df32ws-389shj-ks78ol
Output Null
--Update
Adding the answer by #MarkKromerMSFT for reference. Thanks Mark!
toInteger(null()) will work.
If you go through the official MS doc here for iif
Based on a condition applies one value or the other. If other is
unspecified it is considered NULL. Both the values must be
compatible(numeric, string...).
So you can try just,
iif(instr({userID},'_') > 0,toInteger(split({userID},'_')[2]))

How can I make PyCharm break when a variable takes a certain value?

I have a big dictionary and some of the elements occasionally end up with illegal values. I want to figure out where the illegal values are coming from. PyCharm should constantly monitor the values of my dictionary, and the moment any of them take the illegal value, it should break and let me inspect the state of the program.
I know I can do this by just creating a getter/setter for my dictionary instead of accessing it directly, and then break inside the setter with an appropriate condition.
Is there a way to do it without modifying my code?
I'm not sure if this answers your question but you can set a breakpoint on the line of code you want to break at, right click on that break point once it is set and then apply a condition.
An example of such a condition could be:
x > 5
Once you are at the stage in your loop/code where this condition is true i.e. when x = 6 then it will break and you can inspect all the current values/ status of your code.
Hope this helps

How to get fields of a Julia object

Given a Julia object of composite type, how can one determine its fields?
I know one solution if you're working in the REPL: First you figure out the type of the object via a call to typeof, then enter help mode (?), and then look up the type. Is there a more programmatic way to achieve the same thing?
For v0.7+
Use fieldnames(x), where x is a DataType. For example, use fieldnames(Date), instead of fieldnames(today()), or else use fieldnames(typeof(today())).
This returns Vector{Symbol} listing the field names in order.
If a field name is myfield, then to retrieve the values in that field use either getfield(x, :myfield), or the shortcut syntax x.myfield.
Another useful and related function to play around with is dump(x).
Before v0.7
Use fieldnames(x), where x is either an instance of the composite type you are interested in, or else a DataType. That is, fieldnames(today()) and fieldnames(Date) are equally valid and have the same output.
suppose the object is obj,
you can get all the information of its fields with following code snippet:
T = typeof(obj)
for (name, typ) in zip(fieldnames(T), T.types)
println("type of the fieldname $name is $typ")
end
Here, fieldnames(T) returns the vector of field names and T.types returns the corresponding vector of type of the fields.

If statement not behaving itself

I have a very simple if statement that is looking to see if $_FILES[] is set and if so create a variable. Here it is:
if(isset($_FILES['photo']['name'])){$image="yes";}
So if it finds the files is in fact set, give $image the value of yes. At the moment, regardless of if its set or not, the value is being passed to $image. Its driving me nuts. Doesnt matter if I drop the ['name'] part even. Ive been doing every incarnation of the if statement I can think of to make it behave but Im at a loss.
It turns out that checking to see if $_files isset will return a value in that even with no file being uploaded the array will contain information. If you were to do var_dump on $files['photos']['name'] you will see that the value for that bit of information is 0 and therefore when checking to see if its set you will get a positive response. This is how I overcame my problem:
$foo =$_FILES['photo']['name'];
$foopoo = $foo[0];
if (strlen($foopoo)>2){$image= "yes";}

customAttributes function's arguments are set as NAN

I'm trying to work with the customAttributes of Raphael.
But I the problem is with the arguments inside the customAttributes functions are NAN. Please have a look at this http://jsfiddle.net/5CxVW/1/. In console NAN is logged instead of the h,s,b values and undefined is logged for the path1. What I'm expecting is the step values of h,s,b inside the customAttributes function. Also I want to know how to pass any raphael objects to customAttributes function
this seems to work, but I'm not sure why. I've given the path an initial value for hsb, and then animated. Also, I've pulled the path parameter from the customattribute. This was me hitting it with a hammer until it worked, as opposed to surgically dissecting it and working out exactly why it doesn't work.
So on the one hand, horray, it's working. On the other, I've no idea why.
N.
PS. Oh, wait. you're animating the hsb, which means its adding a fractional value to the intial value until the animation is over. If you haven't set the value first, maybe that's why its failing. undefined + .0012 = NaN?

Resources