What is the mean of [-] and [+] in silktest script - ui-automation

I got a project to convert Silk Test to some other GUI testing framework. I can't understand how the Silk Test script organized by [-] and [+] signs.
are there someone help me to understand the meaning? Here is a sample script
[+] if(AssignSymbolToCatalogNumber.Exists(4))
[ ] AssignSymbolToCatalogNumber.setActive()
[ ] Sleep(1)
[ ] AssignSymbolToCatalogNumber.notMapToCatalog.SetFocus()
[ ] AssignSymbolToCatalogNumber.notMapToCatalog.Click()
[ ] WaitForDialogExists (Keep)
[-] if !Keep1.Exists (1)
[ ] ResLog.LogFail ("The number {i} Keep dialog did not pop up!")
[ ] goto EndProgram
[-] else
[ ] Keep1.SetActive ()
[ ] Keep1.RadioList1RL.Select ("#1")
[ ] Keep1.ShowEditDialogAfterEachCK.Check ()
[ ] Keep1.OK.Click ()
[ ]
[ ] WaitForDialogExists (InsertEditChildComponent)
[-] if !InsertEditChildComponent.Exists (1)
[ ] ResLog.LogFail ("Insert/Edit child component dialog did not pop up!")
[ ] goto EndProgram
[-] else
[ ] InsertEditChildComponent.SetActive ()
[ ] InsertEditChildComponent.ParentSiblingPB.Click ()
[ ]
[ ] Sleep (1)

In Silk Test's 4Test language, blocks are indicated by an additional tab-character in the indentation, similar to Python.
The [+] and [-] tags are an indication for the code-editor that a new block begins and also encode the folding status of that block. That means that when you fold that block in the IDE, it will become [-] and if you open it up again, it will become [+].
For the purpose of running a script they make no difference, it's only relevant for displaying the code.

Related

Send mail using SQL Server

I am trying to send an email from a Trigger, on SQL Server 2008 . The data of the email will be, just a plain hardcoded text.
When user clicks on a trigger button from application my sp needs to send mail to specified users.
(Do i need to specify the users somewhere?)
Can someone provide some sample code on how to do this, please?
I've not set up any SQL mail and stuff, so I'm guessing it's built in.
like you set first you need to configure you SQL instance
Permissions
You must be a member of the sysadmin fixed server role to
use the Send Test E-Mail dialog box. Users who are not members of the
sysadmin fixed server role can test Database Mail using the
sp_send_dbmail procedure.
Procedure Using Object Explorer in SQL Server Management Studio,
connect to an instance of SQL Server Database Engine where Database
Mail is configured, expand Management, right-click Database Mail, and
then select Send Test E-Mail. If no Database Mail profiles exist, a
dialog prompts the user to create a profile and opens the Database
Mail Configuration Wizard.
In the Send Test E-Mail from dialog box, in the Database Mail Profile
box select the profile you want to test.
In the To box, type the e-mail name of the recipient of the test
e-mail.
In the Subject box, type the subject line for the test e-mail. Change
the default subject to better identify your e-mail for
troubleshooting.
In the Body box, type to body of the test e-mail. Change the default
subject to better identify your e-mail for troubleshooting.
Select Send Test E-Mail to send the test e-mail to the Database Mail
queue.
Sending the test e-mail opens the Database Mail Test E-Mail dialog
box. Make a note of the number displayed in the Sent e-mail box. This
is the mailitem_id of the test message. Select OK.
On the Toolbar select New Query to open a Query Editor window. Run the
following T-SQL statement to determine the status of the test e-mail
message:
SQL
Copy SELECT * FROM msdb.dbo.sysmail_allitems WHERE mailitem_id = ;
click here to see the documentation
here is the sintaxis to use it.
Syntax
Copy
sp_send_dbmail [ [ #profile_name = ] 'profile_name' ]
[ , [ #recipients = ] 'recipients [ ; ...n ]' ]
[ , [ #copy_recipients = ] 'copy_recipient [ ; ...n ]' ]
[ , [ #blind_copy_recipients = ] 'blind_copy_recipient [ ; ...n ]' ]
[ , [ #from_address = ] 'from_address' ]
[ , [ #reply_to = ] 'reply_to' ]
[ , [ #subject = ] 'subject' ]
[ , [ #body = ] 'body' ]
[ , [ #body_format = ] 'body_format' ]
[ , [ #importance = ] 'importance' ]
[ , [ #sensitivity = ] 'sensitivity' ]
[ , [ #file_attachments = ] 'attachment [ ; ...n ]' ]
[ , [ #query = ] 'query' ]
[ , [ #execute_query_database = ] 'execute_query_database' ]
[ , [ #attach_query_result_as_file = ] attach_query_result_as_file ]
[ , [ #query_attachment_filename = ] query_attachment_filename ]
[ , [ #query_result_header = ] query_result_header ]
[ , [ #query_result_width = ] query_result_width ]
[ , [ #query_result_separator = ] 'query_result_separator' ]
[ , [ #exclude_query_output = ] exclude_query_output ]
[ , [ #append_query_error = ] append_query_error ]
[ , [ #query_no_truncate = ] query_no_truncate ]
[ , [ #query_result_no_padding = ] #query_result_no_padding ]
[ , [ #mailitem_id = ] mailitem_id ] [ OUTPUT ]
click here to se the documetnation how to use.

How to parse date pattern using grok

How to parse the below log line using grok
Also how to match the pattern of the date.
I tried %{TIMESTAMP_ISO8601:logtime} but no match
Log Line:
13-Nov-2019 00:00:20.230 DEBUG [[ACTIVE] ExecuteThread: '272' for queue: 'weblogic.kernel.Default (self-tuning)'] [196.157.7.12] 965929132 [wire] >> "[\n]"
The question is a bit unclear as to exactly what fields you want them mapped to.
So, here's what matches for me:
%{MONTHDAY:day}[-]%{MONTH:month}[-]%{YEAR:year} %{TIME:time} %{WORD:logtype} \[\[%{WORD:status}\] ExecuteThread: '%{NUMBER:threadNumber}' for queue: '%{GREEDYDATA:queueData}'\] \[%{IP:ip}\] %{NUMBER:numbers} \[%{WORD:text}\] >> "\[\\n\]"
The first 4 fields, answer your date/time pattern query and the rest is what I have used to fit the rest of the fields. Since, no exact mappings were provided , I have mapped them as per my understanding using
This is the output:
{
"day": [
[
"13"
]
],
"month": [
[
"Nov"
]
],
"year": [
[
"2019"
]
],
"time": [
[
"00:00:20.230"
]
],
"logtype": [
[
"DEBUG"
]
],
"status": [
[
"ACTIVE"
]
],
"threadNumber": [
[
"272"
]
],
"queueData": [
[
"weblogic.kernel.Default (self-tuning)"
]
],
"ip": [
[
"196.157.7.12"
]
],
"numbers": [
[
"965929132"
]
],
"text": [
[
"wire"
]
]
}
You can break 'time' further if you want. For any other combinations of patterns, refer Grok Patterns.

going to target and home within one tick

I want my turtles to go to a target and go home again (using fd) within the time period of one tick. The model works fine when I execute the go procedure one by one ("go once"). Execution as a loop (without altering the code), however, doesn't work: The turtles don't move; the tick counter is updated though. It seems that the functions are executed correctly but the movement is not visualized. Thanks for your help!
to go
if ticks >= 365 [ stop ]
move
if not any? turtles with [ shape = "person" and movement-done? = false ]
[
tick
ask turtles with [ shape = "person" ] [
set movement-done? false
set reached? false
set at-home-again? false ]
]
end
to move
ask turtles with [ shape = "person" ]
[
if movement-done? = false
[
ifelse reached? = false
[
ifelse patch-here = target [ set reached? true set at-home-again? false ]
[
face target
fd 1
]
]
[
ifelse at-home-again? = false
[
ifelse patch-here = myhome [ show "patch-here = myhome" set at-home-again? true ]
[
face myhome
fd 1
]
]
[
set movement-done? true
]
]
]
]
end

Changing the color of myself

I have the following code where I ask some agents to die:
breed [ readers reader ]
breed [ pallets pallet ]
breed [ trucks truck ]
readers-own [
truck-being-served
pallet-being-served ]
to complete-service [ ?reader ]
ask ?reader [
ask pallet-being-served [ die ]
set pallet-being-served nobody
ask truck-being-served [
if not any? pallets-in-truck [
ask self [ die ]
ask myself [
set truck-being-served nobody
set color green
set next-completion-time 0
]
]
]
]
end
Where pallet-being-served and truck-being-served are pallets and truck agents.
The problem is that the inner ask myself [... it seems not working, bacause the color of the ?reader agent does not change to green. Here I am not sure if I am referring to ?reader or to truck-being-served agent which I have just killed. I would like to change the color to green. Is ask myself [ ... referring to the reader agent?
Regards.
Asking a dead turtle to do something has no effect. Also, please provide a minimal runnable example that illustrates your problem.
globals [next-completion-time]
breed [ readers reader ]
breed [ pallets pallet ]
breed [ trucks truck ]
readers-own [
truck-being-served
pallet-being-served ]
trucks-own [pallets-in-truck]
to setup
ca
create-readers 1
create-trucks 1
create-pallets 1
ask reader 0 [set truck-being-served truck 1]
ask truck 1 [set pallets-in-truck pallets]
ask reader 0 [set pallet-being-served one-of [pallets-in-truck] of truck 1]
end
to complete-service ;reader proc
ask pallet-being-served [ die ]
ask truck-being-served [
if not any? pallets-in-truck [
ask myself [
set color green
set next-completion-time 0
]
die
]
]
end
to test
setup
ask reader 0 [complete-service]
end

How to set the color of a link with another agent under condition

I would like to change the color of the links that join one agent (reader's breed) to other readers that have a flag (TM? = true). The code is something like this:
breed [ readers reader ]
undirected-link-breed [ rris rri ]
readers-own [ TM? ]
to start-TM [ ?reader ]
ask ?reader [
if any? other readers with [ TM? = true ] [
let other-TM-readers other readers with [ TM? = true ]
ask my-rris with [other-TM-readers] [ set color red ]
]
]
end
which returns me an error in the line ask my-rris with [other-TM-readers] [ set color red ] because with is expecting true or false and not an agentset.
How could I select the rri links that connects current ?reader with the readers that have TM? = true?
Regards
When you write:
let other-TM-readers other readers with [ TM? = true ]
you tell NetLogo to assign the agentset of all the readers for which TM is true to the other-TM-readers variable. So when you then write:
ask my-rris with [other-TM-readers] [ set color red ]
you are passing the other-TM-readers agentset to with, just like NetLogo is saying in its error message.
This is easy to fix, but first, a comment: writing = true is almost always superfluous. Your TM? variable is already a boolean, so you can check for it directly by writing with [ TM? ] instead of with [ TM? = true ].
Now, to fix the error, you can write:
let other-TM-readers other readers with [ TM? ]
ask other-TM-readers [
ask rri-with myself [ set color red ]
]
or just:
ask other readers with [ TM? ] [
ask rri-with myself [ set color red ]
]
You could also ask the links directly, and use the other-end primitive to check the color of the neighbors:
ask my-rris with [ [ TM? ] of other-end ] [ set color red ]
That last version is also safer than the previous versions, because it does not assume that there is a link between the caller and the other readers: it will only ask the links that are actually present. (The first two versions could check that rri-with myself != nobody, but that would be less elegant.)