Problems reading an empty cell from Excel with Robot Framework - robotframework

882 / 5.000
Resultados de tradução
I'm trying to test the required fields of a form and for that I'm reading the data from an Excel spreadsheet, leaving the cell of the spreadsheet that corresponds to the field in the form unfilled. The problem is that Robot reads the empty cell as None and instead of leaving the field empty in the form, it is writing the string None which is different from empty. Does anyone have a suggestion on how to make Robot bring empty or make None empty when inputting the form?
${Username} Read From Cell (1,{counter})
Input Text <locator> ${Username}
Imagine that the cell is empty, in this case it returns a None for the variable ${Username} and in this case instead of leaving the field empty, RB inserts None in the Username field and the test fails, as I am waiting for a message of the type : The Username field cannot be left blank.

To Avoid this, add condition like below before you execute any keywords
Run Keyword IF "${cell_value}" != "None" Input Text ${xpath} ${cell_value}

Related

How to check an "empty" fill-in field which is not empty due to the format?

I have a window, containing some fill-in fields. One of them is meant to contain a date, having 99/99/9999 as a format. Due to that format, when emptying the field (selecting the content and press the DEL button), I see "__/__/____" on screen (the underscores mean spaces).
In order to check if this fill-in field is empty, currently the source code does this as follows:
IF Date_Fill-In:SCREEN-VALUE <> "/ /"
As you can see, this is heavily dependent on the format of the fill-in field.
Is there a built-in function I can use to check if the screen-value of a fill-in field is empty, without needing to check the format?
Thanks in advance
Dominique
Check for the INPUT-VALUE property returning ?.

Input fields are getting pre-populated with a const value even when there is no query-parameter in url

I wrote a code where the first screen will accept a query-parameter from URL and pre-populate the respective input field. say
<-----url------->?qparam=1234 - this will populate 1234 in input field
<-----url------->?qparam=5678 - this will populate 5678 in input field
But now what happening is if I sent no query-parameter.
<-----just-url-------> - then still a constant value is getting populated say 1234.
Assuming that the same constant value (1234) is used multiple times as query-parameter, I tried checking if it is getting populated from the cache. I hit the same URL (without any query-parameters) in incognito mode but still, the same value populated.
I checked and that value is not hard-coded anywhere.
and
Note- when I again hit the URL with different query-parameter say
<-----url------->?qparam=1122 - this populates 1122 in input field as expected.
but again when this is hit <-----just-url-------> - then again the constant value is getting populated here 1234.
what could be the reason? if it's cache-related please explain explicitly? also if possible tell if there is any other way to test if the value is getting fetched from the cache?
Thanks in Advance!

If else loop in robot framework

There are 3 set of records which I want to capture from an external excel sheet to follow the data driven approach. Scenario: There are 5 fields in the online screen: Grp No/Blclass/Bnk Code/Brnc Code and Acct No.
Now upon providing the grp and blclass and click on "Create", then the other 3 fields will get enabled for data input and when data input done for all fields, the clicking on submit will successfully complete the transaction input for a particular row from external excel.Then it will pick the second record from excel and do the same and so on... Now the scenario is Suppose for the second record,if the acct no is wrong, then it will show an online error and will not allow user to "Submit". At the same time, the header section(grp and billing class) will not be enabled for inputting the next data until user click the exit button because of that online error.
Now I am new in Robot Framework and tried with "Run Keyword If" but somehow it did not work.
Here are the code that I have used. If all the data in the excel are correct, then it will input the transaction one by one for all rows. But,if any wrong data found, my purpose is to skip that input and proceed for the next record as below.
Objective after clicking Submit Button:
If error found, click Exit button and input the next record - as without exit, the header fields will not be enabled for data input
Else input the next record as per loop
You can try :
Run Keyword If '<condition1>' == '<value1>'
... ELSEIF '<condition2>' == '<value2>'
... ELSE <value3>
This works for me.

Laravel Form input type="text" select data from another table on type type suggest existing data from the table and select

How can i create a form like the one on linkedin. On form input type when i type is going to fect data from a database if not existis is going to create it and fetch d and store to another table
on form input type, immediately get result: This can be done by AJAX. Laravel support Vue which can do this easily:
1a. call a function in the mounted() part.
1b. the function call itself by putting setTimeout(this.functionName,1000) at the end.
1c. in the function, check if the text in the text box is changed. if yes, make a request by axios.get('blablabla').then(response=>{//put the response into vue dataArrayName in data part});
1d. the html template is auto-updated by v-for="dataArrayName"
looks like the search is done by comparing char by char from the beginning of the string to the data.
if you press enter, pass the search string to the controller, use some logic to determine whether it is needed to create row in database

Spring MVC 2.5 Command object value is changed on form submit

I have a string variable in command object which is a hidden tag in my jsp.
An on click of a button i'm setting this variable with a value(example "test") and submitting the form.
On form submit, I get the control to my Validator.validate() method.
In this method the value of the variable in command object is changed that is comma is getting appended to the value(Example "test,").
I have checked debugging at the java script side, correct value is set to the variable there(it doesnt have the extra comma appended to it) but when it reaches the validator its value is changed.
I'm not understanding why only that particular variable value is getting changed while all other values are set correctly.
Please suggest how should i rectify this
Are there two form fields with the same name. When two form fields have the same name - the values could get appended in a list.

Resources