${url}= Selenium2Library.GetLocation
Put String to Cell Test 1 0 ${url}
Is this Right?
You need to have at least two spaces between a keyword and each argument. I don't know anything about Put String TO Cell, but assuming all of the text following it are separate arguments, it should be something like this:
Put String to Cell Test 1 0 ${url}
Related
The string is "Some Words(1440)" and I want to store the numbers inside the parenthesis as a variable in twig so it can be output and used. I thought maybe I could do it with a split but I wasn't able to escape the parenthesis properly.
What I have:
Some Words (1440)
What I want to extract from the string is just the numbers in parenthesis
1440
Here's my list
#{referentiel} N1(exemple)/N2(exemple) N2(exemple)/exemple
where i use it
Visca barca
[Arguments] ${index}
Click Element Using Javascript //div[#id='mat-select-value-5']
Click element of long page //span[#class='mat-option-text'][contains(.,'#{referentiel}[${index}]')]
And my testcase
we are the best
Visca barca 1
Error :
Value of variable '#{referentiel}[${index}]' is not list or list-like.
The issue you are describing here has nothing to do with the semicolons or slashes. The issue is actually that you are attempting to return the list item with wrong decorator.
To get a single item from a list you should use $ instead of #. When you use # Robot will attempt to return you a list which it cannot since the item on ${index} is a string.
See below:
#{referentiel} # == ['N1(exemple)/N2(exemple)', 'N2(exemple)/exemple']
or
${referentiel[0]} # == N1(exemple)/N2(exemple)
Hi I am trying to create a query for SQLite which has a variable part in it. By variable I mean that a certain part within the string can possibly contain a variable but also an empy value
I tried this but I am not sure whether this works.
SELECT * FROM table WHERE attr LIKE 'ABC% %DEF'
Adding onto my comment, check the below code to test your values.
SELECT CASE WHEN 'ABC G DEF' LIKE 'ABC%DEF'
THEN 1
ELSE 0 END as test_space,
CASE WHEN 'ABCGGGDEF' LIKE 'ABC%DEF'
THEN 1
ELSE 0 END AS test_all
So there's a nice keyword in RFW which is:
Table Cell Should Contain,
But now It should check the tabletext against a regexp. but it doesn't seem to work that way, because it says,
text not found
*** Variables
${pattern2} ^[0-9]{1}[0-9]{1}
Table Cell Should Contain xpath=//div[#id='components_block']/table 2 6 ${pattern2}
this doesn't work: either i guess:
Table Cell Should Contain xpath=//div[#id='components_block']/table 2 6 regexp:^[0-9]{1}[0-9]{1}
Regretfully, no, in Robot Framework you cannot chain keywords - to use the output of one directly as an input for another. You have to have intermediate/temp variables for that.
For the case here, you want to see does a table cell has text, matching a specific regular expression. As the keyword Table Cell Should Contain does not support regexp in the looked-for argument, but only normal strings, you can't use it.
Break down this verification in 2 steps - first get the text in the cell (in a temp variable), and then see does it match the regular expression with the Should Match Regexp keyword:
*** Variables ***
${pattern2} ^[0-9]{1}[0-9]{1}
*** Testcases ***
A case
${temp variable}= Get Text xpath=locator_that_will_return_the_specific_cell
# alternatively, you can use this keyword - if the table is an actual <table> element in the html
# ${temp variable}= Get Text xpath=locator_that_will_return_the_table 2 5
# now having the text in the cell, see does it match the regexp
Should Match Regexp ${temp variable} ${pattern2}
As to what are the values of "locator_that_will_return_the_specific_cell" and "locator_that_will_return_the_table" - I can't tell you; nor anyone else, without a sample of the HTML.
I found I direct match/hit to the table location like so: xptah=//tr[1]/td[4]
then I could do this:
${gettext} Get Text xpath=//tr[1]/td[4]
Should Match Regexp ${gettext} ^[0-9]{1}[.]{1}[0-9]{1}[0-9]{1}
sorry I am a bit rusty here, how do I concatenate these 2 outputs?
display.println(timeinfo->tm_hour);
display.println(timeinfo->tm_min);
If you just want them to appear in the output one after another on the same line then use print instead of println for the first one. Println adds a newline to the end of the output and print doesn't. It's always good to look stuff like that up before using a function.
If you really want them put together into one string then you will have to show where those strings are coming from. If they are String class objects you can just use + to put them together. If they are proper c-style strings then you will need to use strcat.
How are defining them?
If you have initialized as arrays of characters:
Example: char exampleCString[50] = "This is a C string";
Then you can use strcat() function in C:
strcat(str1,str2);
Note: Make sure "str1" buffer is big enough, because the result goes there.
If on the other hand, you have initialized your strings as objects of String class:
Example: String exampleJavaString="This is a Java String example"
Then just use the + operator to add them:
str1=str1+str2: