Using Value obtained with Get Value - selenium

I am very new to using Robot Framework, and I am using the RIDE development environment. I am trying to obtain a value from an element on a website, and then set a variable with that value. The keyword Get Value only accepts one argument from what I can see, and I cannot find any documentation explaining how to do this. This question is similar to another SO question but I am unclear on how to assign this data to a variable.
Any help is greatly appreciated!
--edit--
here is the element that i am trying to obtain data from:
<div class="highlight-box animate ng-binding" animate-change="master.user.balance.toFixed(2)" id="header-balance">
0.00
</div>
I tried setting the variable like this:
#{balance} get value header-balance
as suggested, and it didnt throw any errors, but then when I tried to use the variable with an input text:
input text Textbox-1 #{balance}
it threw an error saying that input text requires two arguments. I took this to mean that the variable did not contain anything, regardless of being set in the last line.

To set a variable with the value obtained, just add the variable name as first element in your statement. Something like:
${variable} = Get Value id=my_element

Related

Pentaho PDI - Not setting constant

I can't for the life of me figure out why my transform which I have setting a 'constant' value is not setting it? Anywhere I can look for details?
Here's the add header - constant step
So WHY do I not get my test value in the output??
I even tried 'set field value to constant' step which takes the one row coming from my filer step and sets it to a constant value which also produces nothing! IDK whats going on here!
Thanks for the suggestions… I actually figured this out it has to do with the fact that the text output steps have a setting to not create when the transformation first starts I had to check that box…

How to use Get command in Monkey talk?

Does anybody know how to use the Get command in monkey talk?
In monkey talk guide only the command is written but no syntax is present.
Here is an example for you,
var x = app.label("label1").get("x","value")
Above line will get the value of label1 and store it in variable x. You can change the second parameter "value" to ".text" or ".size" depending on your needs
since the question is not marked Answered and For the future reference i am answering this.
‘GET’ ACTION RETRIEVES COMPONENT PROPERTY VALUES
Syntax:
ComponenType MonkeyId Get varName propName
Works like an assignment statement (varName= propName)
The default property is “value”
// Get label value currently displayed
Label lastname Get name
// Enter name into input field
Input query EnterText ${name}
// Get the first table item
Table countries Get country items1
// Enter into input field
Input * EnterText ${country}
you can refer this document here, thanqs
I will try to explain using example. Suppose there is a ListView(Table) and you want to scroll till its last item.
//Define a variable
Vars * Define row
//Store size of list in variable row using Get. Check use of "Get" here
Table * Get row size %thinktime=20000
//Now stored variable can be used as per need. here I am using for scrolling
Table * ScrollToRow ${row} %thinktime=2000
Hope it helps you !!

Adobe Livecycle: how to get the value of process data

I have a process data defined in Adobe livecycle, addField as a string. I am passing the value of this variable as an input when i invoke a process. Further i want to compare the value of this process data if it is true or false. I am trying to use the following expression:
string(/process_data/#addField)=string("true")
but i am not getting the value out of the expression. Is the above expression true? If not what is used to get the value of the process data?
I believe your XPath expression is wrong. I just did a quick mock-up in workbench and I got the correct response. Here are the details of what I did:
Created an input string variable i workbench called addField.
Created a two step process. The first step has two routes going out to two different set values.
On one of the routes, I added the following condition:
/process_data/#addField = "true"
Turned on recording, and invoked the process.
In the input parameters screen in workbench, I added the following text: true
In the recording, I can see the expression evaluating correctly and going to the correct set value.
Do let me know if you have any other questions.
Thanks,
Armaghan.

Formatting a variable in iReport according to specified pattern

I'm trying to build a report with iReport. I have defined the a variable named: totalCosts. This variable is based on this expression:
$V{costs}.multiply(new java.math.BigDecimal($F{numberOfItems}.intValue()))
I want to format this variable by the following pattern:
#,##0
What I tried before asking this question:
I tried to use the following variable expression but no success:
new java.math.BigDecimal(new java.text.DecimalFormat("#,##0").format($V{costs}.multiply(new java.math.BigDecimal($F{numberOfItems}.intValue()))))
My variable is a java.math.BigDecimal.
Thank you.
If you are trying to display the variable in a report, then normally you should just have a Text Field with a value of "$V{MyVariable}" (without the quotes). Set the pattern for that Text Field as you like. It saves you all of the trouble of formatting things yourself.

How to test for blank text field when using robotframework-selenium?

How can I specify blank/empty value for a text field when using the robotframework-seleniumlibrary with a TSV file? For example, I have the following:
Textfield Value Should Be identifier=name1 Chris
Textfield Value Should Be identifier=name2
I want to test that name2 is blank. I have tried leaving it blank (which returns a message about an incorrect number of arguments. I have tried "", which looks for a pair of quotes, and '' which enters a single quote, and selenium seems to look for that
You can use either a single backslash \ or special variable ${EMPTY} to create an empty string in the test data. User guide has the details: Robot Framework User Guide.
Yes, ${EMPTY} is a built in variable.
There are many examples, see an example here
${EMPTY} is good for a blank value but, surprisingly, it didn't work for an empty value.
I found what I was looking for. The field I was verifying had no value in its value attribute and I wanted to verify it. It was returning '' as the value and when using ${EMPTY} it couldn't find '''' instead. Such a minor thing but ended up solving what I needed, so it depends what you're seeking to verify.