Robot framework get result - return

I trying to use the library SapGuiLibrary and want to get some values from SAP.
In my test case I have:
SapGuiLibrary.Get Row Count wnd[0]/shellcont[1]/shell
But how to I output the value to log or a file?

Assuming that the keyword returns the value, you can save it to a variable. You can then log the variable.
${result}= SapGuiLibrary.Get Row Count wnd[0]/shellcont[1]/shell
log to console ${result}

Related

Create if condition with modx UrlParam

I got the value of the urlParam "image". No i want to show an image only if the Param is 1.
[[getUrlParam? &name=`image` &int=`1`]]
How can i do that?
You can use MODX output filters to achieve this.
Using the output filters (:eq and :then) you can show the image as you wish.
The output of the getUrlParam snippet is automatically submitted to the output filter :eq which then checks the desired value.
Please make sure that you use an uncached snippet call in this case ([[!getUrlParam...]]) because you are dealing with data that changes every time the page is re-rendered/called. If you fail to do this the value of the GET variable will be cached after the first page call which will lead to inconsitencies in your desired result.
[[!getUrlParam:eq=`1`:then=`<img src="/foobar.png" alt="Some img">`? &name=`image` &int=`1`]]

Not able to read next record while browsing KSDS in CICS

I am trying to read a VSAM KSDS file sequentially using STARTBR and READNEXT. I am able to read the 1st record. After processing 1st record, I was expecting the read of 2nd record from the VSAM when READNEXT is executed but only first record is read again. Could you please help here? I am using same lines 2 times: 1 after STARTBR and 1 while reading the next record after 1st.
MOVE LENGTH OF WS-INPUT-DATA TO X01-KEY1-LENGTH
EXEC CICS READNEXT DATASET(X01-INPUT-NAME)
INTO(WS-INPUT-DATA)
RIDFLD(X01-KEY1)
LENGTH(X01-KEY1-LENGTH)
RESP(X-RESP)
END-EXEC
From the description it looks like the RIDFLD has changed between the 1st and 2nd requests, possibly cleared, that will cause the browse to be repositioned to look for the next record after the new value passed in RIDFLD.
Make sure that on the 2nd READNEXT that the RIDFLD has the value returned by the 1st READNEXT.

Struts 2 issue in Post request

I have form in which there are various fields.I have cross checked all fields by making my form as get type and cross checked all query string parameters .
Now let say there are 10 parameters in query string and in action while doing manipulation i am only using 5 or 6 fields and remaining 4 fields are not coming in query string.
Now the problem is if i want to trace where my code break so if i put log or SOP at the start of action it does not show even SOP.
Just wanted to clear if some parameter which are not coming in query and are not in use i think my code should not break.or how to trace where the code is breaking
I even debug my code bt even that is not working
###################parameters in Query String ###########################
changeReadingFlag=false
&__multiselect_GroupSelect=
&outletId=15
&monthYear=2016-10
&dates%5B0%5D=01%2F10%2F2016
&newMeterReading%5B1%5D=01-Oct-2016
&dates%5B0%5D=01%2F10%2F2016
&newMeterReading%5B1%5D=
&outlettransactionmeterList%5B0%5D.runId=23
&outlettransactionmeterList%5B0%5D.meterReading=500.0
&outlettransactionmeterList%5B0%5D.calculatedMeterUnits=500.0
&hiddenFlag=true
&meterArrayList%5B1%5D.outletTransactionMeterBeanList%5B0%5D.change=Add+New+Week+Reading
&meterArrayList%5B1%5D.outletTransactionMeterBeanList%5B0%5D.weekno=0
&meterArrayList%5B1%5D.outletTransactionMeterBeanList%5B0%5D.customerId=30
&meterArrayList%5B1%5D.outletTransactionMeterBeanList%5B0%5D.newMeterId=17
&meterArrayList%5B1%5D.outletTransactionMeterBeanList%5B0%5D.outlettransactionmeterList%5B0%5D.meterReading=1200
&meterArrayList%5B1%5D.outletTransactionMeterBeanList%5B0%5D.newMeterId=17
&meterArrayList%5B1%5D.outletTransactionMeterBeanList%5B0%5D.customerId=30
&meterArrayList%5B1%5D.outletTransactionMeterBeanList%5B0%5D.outlettransactionmeterList%5B0%5D.isClosedAccount=false
In my action inside method, I am using only those parameters for which value is coming in query string. I have not used validate() method inside action.
Now if I print at start of this function will I get logs or not. Actually I am not getting log.

store query table output in variable

How can I store query output in a variable?
I have following query table:
|Query:SomeQueryClass|
|ObjId|ObjValue|
|someId|<IWantToStoreThisValue>|
I tried following:
|Query:SomeQueryClass|
|ObjId|ObjValue|
|someId|$value=|
However test fails and I have following output
|Query:SomeQueryClass|
|ObjId|ObjValue|
|someId|[realValue] expected [$value=]|
I found another way to solve this problem.
For example $object contains data I need to store in a variable
!|$object|
|getVariable1?|getVariable2?|
|$var1=|$var2=|
and data is stored in var1 and var2

Dynamic READ ...RECORD INVALID KEY not working properly in COBOL. How to fix it?

A Cobol program with file-control like so:
SELECT D-FLAT-FILE ASSIGN TO DFLAT-FILE
ORGANIZATION IS INDEXED
ACCESS MODE IS SEQUENTIAL
FILE STATUS IS RECORD-STAT
RECORD KEY IS D_KEY OF D-FLAT-FILE DESCENDING WITH DUPLICATES.
SELECT C-MAST-FILE ASSIGN TO CMAST-FILE
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
FILE STATUS IS RECORD-STAT
RECORD KEY IS C_KEY OF C-MAST-FILE.
reads a record from the first flat file like so:
PROCESSING.
READ D-FLAT-FILE NEXT RECORD
AT END ....END READ.
and reads a record on the second DYNAMIC file like so:
READ C-MAST-FILE RECORD
INVALID KEY
GO TO PROCESSING.
All works well except for 1 case. If the 1st record from the 1st flat file does not match any records on the 2nd dynamic file, the program goes into an infinite loop instead of doing GO TO PROCESSING. I checked the manuals, all as per manual (it is the VAX Cobol). What am I missing?
Best practice is to use a different FILE STATUS variable for each file. In your case you haven't shown us enough context to see the problem. But if you are in a loop looking at RECORD-STAT, then it is possible that the failed read from C-MAST-FILE is giving you grief.

Resources