How to iterate through list, per test in SilkTest? - list

I wrote Lists (Name, Item, etc.) for my Green Mountain Outpost Applikation.
I want the applikation to run automaticaly the testcase with 1 Persone and Item at the time. So that the app. runs 1 Person from list throug, than the second test with another.
Testcase
Function
List for Name, Item, etc.

[ ] int x = 1
[-] for each Name in customers
[ ] print(Name)
[ ] // Name = customers[x]
[ ] Artikel = items[x]
[ ] CardN = cardnumber[x]
[ ] Expi = expirationdate[x]
[ ] print(Artikel)
[ ] print(CardN)
[ ] print(Expi)
[ ] print("----------------------")
[ ] Bestellung (Name, Artikel, CardN, Expi)
[ ]
[ ] x++

You can mention the data in Excel and make the test case as data driven.
Each row will be having one data combination.

Related

Power query losing reference to the parent record after updating child/nested record

I have the following record:
Source = [
Properties = [
steps = {
[
index = {
[
display = "Something",
data = "data2"
]
},
access = "Column1"
],
[
indices = {
[
display = "Something else",
data = "data2"
]
},
access = "Column2"
]
},
opt = [
key1 = "val1",
key2 = "val2",
key3 = "val3"
]
]
]
I am updating/adding a new field inside the nested record. However, after that I am unable to get the reference to the original record with the modified field.
Here is the M code for the change. I am adding a new field updatedKey3 which contained the capitalized key3 field and then I am removing the key3.
let Source = [
Properties = [
steps = {
[
index = {
[
display = "Something",
data = "data2"
]
},
access = "Column1"
],
[
indices = {
[
display = "Something else",
data = "data2"
]
},
access = "Column2"
]
},
opt = [
key1 = "val1",
key2 = "val2",
key3 = "val3"
]
]
],
step1 = Source[Properties][opt],
step2 = Record.AddField(step1, "updatedKey3", Text.Upper(step1[key3])),
step3 = Record.RemoveFields(step2, {"key3"})
in
step3
step3 returns the record:
[key1 = "val1", key2 = "val2", updatedKey3 = "VAL3"]
However I want this change within the Source record and view it completely. Any help would be appreciated.
I was able to do it by adding, removing and renaming fields. The following is the updated code for it. If anyone has a more optimized way to do so, please let me know.
let Source = [
Properties = [
steps = {
[
index = {
[
display = "Something",
data = "data2"
]
},
access = "Column1"
],
[
indices = {
[
display = "Something else",
data = "data2"
]
},
access = "Column2"
]
},
opt = [
key1 = "val1",
key2 = "val2",
key3 = "val3"
]
]
],
step1 = Source,
step2 = Record.RenameFields(Record.RemoveFields(Record.AddField(step1[Properties][opt], "tmpKey", Text.Upper(step1[Properties][opt][key3])), "key3"), {"tmpKey", "key3"}),
step3 = Record.RenameFields(Record.RemoveFields(Record.AddField(step1[Properties], "tmpOpt", step2), "opt"), {"tmpOpt", "opt"}),
step4 = Record.RenameFields(Record.RemoveFields(Record.AddField(step1, "tmpProperties", step3), "Properties"), {"tmpProperties", "Properties"})
in
step4

normalized_boxes are bigger then one(1) - AWS SageMaker JumpStart SSD VGG16 Atrous 300

I deployed SSD VGG16 Atrous 300 model(COCO 2017, from Gluon CV) by AWS SageMaker JumpStart. Response from pretrained model contains normalized_boxes with values bigger than one(1), e.g.
"normalized_boxes": [
[
0.4935379866715316,
0.20722445845603943,
0.7275399344308036,
0.7329685688018799
],
[
1.9931350875686813,
0.15846982598304749,
2.275825517256181,
0.5962902307510376
],
...
"classes": [
0,
0,
...
"scores": [
0.344256728887558,
0.4128507971763611,
...
"labels": [
"person",
"bicycle",
...
"mxnet_model_output": [
[
[
[
0
],
[
0
],
...
[
[
[
0.9202409386634827
],
[
0.9055193662643433
],
...
[
[
[
1551.213134765625,
589.4755249023438,
1808.19921875,
878.4844360351562
],
[
1557.686767578125,
310.9128112792969,
1805.559814453125,
587.8072509765625
],
...
How to read those bounding boxes?
I didn't manage to find the answer on gluon(https://cv.gluon.ai/model_zoo/detection.html)
The model can be fine-tuned, the rules how to prepare annotations(available in model description):
"The annotations.json file should should have information for bounding_boxes and their class labels. It should have a dictionary with keys "images" and "annotations". Value for the "images" key should be a list of entries, one for each image of the form {"file_name": image_name, "height": height, "width": width, "id": image_id}. Value of the 'annotations' key should be a list of entries, one for each bounding box of the form {"image_id": image_id, "bbox": [xmin, ymin, xmax, ymax], "category_id": bbox_label}."
names of attributes are the same as in the COCO dataset - https://www.immersivelimit.com/tutorials/create-coco-annotations-from-scratch/#coco-dataset-format
only this part is not consistent with COCO: "[xmin, ymin, xmax, ymax]" as I found, COCO has "[x_min, y_min, width, height]"(https://albumentations.ai/docs/getting_started/bounding_boxes_augmentation/)
I tired also SSD VGG16 Atrous 512(pre-trained on VOC dataset) and faced the same problem, additionally, I received bbox value with a minus:
"normalized_boxes": [
[
0.9567698719737294,
-0.14875292778015137,
1.0963617010430975,
0.5834765434265137
],
...
How to deal with values smaller than 0?

How to get index value of a scrollview at certain position?

I have a horizontal scrollview like below with V as an overlay and it acts like a pointer:
V
[ 0 ] , [ 1 ] , [ 2 ] , [ 3 ] , [ 4 ] , [ 5 ]
^
When I scroll, I would like to print the value or index that is in the current pointer.
Eg. scroll until [2] and it will print "2".
V
[ 2 ] , [ 3 ] , [ 4 ] , [ 5 ]
^
Could you guide me on how to achieve this?
I ended up using offset for this. Set a fixed width for a column, then we can calculate the offset for each column.

Is there an option to show gtest case run/result in one line?

I don't want to see duplicate names exploring scenarios (especially confusing when there are a lot of tests).
Default: Wish:
[ RUN ] Help.I_need_somebody [ RUN OK ] Help.I_need_somebody (0 ms)
[ OK ] Help.I_need_somebody (0 ms) [ RUN OK ] Help.not_just_anybody (0 ms)
[ RUN ] Help.not_just_anybody [ RUN OK ] Help.you_know_I_need_someone (0 ms)
[ OK ] Help.not_just_anybody (0 ms) [ RUN OK ] Help.Help (0 ms)
[ RUN ] Help.you_know_I_need_someone
[ OK ] Help.you_know_I_need_someone (0 ms)
[ RUN ] Help.Help
[ OK ] Help.Help (0 ms)
Any tips?

Grok pattern with this log line

basically I need to filter out Date - SEVERITY - JAVACLASSNAME - ERROR MESSAGE.
This is working for me..But its just half done.
(?[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2},[0-9]{3}) %{WORD:Severity}(?:%{GREEDYDATA:msg})
It doesnt show Javaclass..!
Here is the output I get
{
"Timestamp": [
[
"2015-03-03 03:12:16,978"
]
],
"Severity": [
[
"INFO"
]
],
"Error_Message": [
[
" [http-bio-16006-exec-71] [XYZ.ABC.JLM.app.task.ERT] [app:/saas reqid:23121221 jsid:* aid:* uid: org: vorg: un:] - Received to update queued for monitorId=54213213JBNJBSJBSJBS, worklow=8u298u2189u312, session=21684216814321"
]
]
}
LOGLINE
2015-03-03 03:12:16,978 INFO [http-bio-16006-exec-71] [XYZ.ABC.JLM.app.task.ERT] [app:/saas reqid:23121221 jsid:* aid:* uid: org: vorg: un:] - Received to update queued for monitorId=54213213JBNJBSJBSJBS, worklow=8u298u2189u312, session=21684216814321
This should work:
filter {
grok {
match => [
"message",
"%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:severity} \[(?<threadname>[^\]]+)\] \[(?<classname>[^\]]+)\] %{GREEDYDATA:message}"
]
overwrite => ["message"]
}
}