Run Keyword In Separate Thread keyword not found even though it's in the script - robotframework-swinglibrary

I have a robot script with the following keywords:
Enter New Data Group
SelectDialog New Data Group
Button Should Be Disabled okButton
Type Into Text Field nameTextField EnteredByRF1
Type Into Text Field descriptionTextArea EnteredByRF1
Button Should Be Enabled okButton
Push Button okButton
Run Keyword In Separate Thread Check OverWrite
Check OverWrite
SelectDialog New Data Group
Push Button OK
SelectDialog New Data Group
Push Button Yes
When I run the script, it gets to the Run Keyword in Separate Thread and produces a Keyword Not found error. I understand from the docs that to handle a popup that may or may not appear, it needs to go in a separate thread.
If I run it without the Separate Thread keyword, it works fine, IF the popup appears. No popup, it fails.
How are you supposed to use this keyword? Is it the right solution for this test scenario?

After some experimentation, it appears Run Keyword In Separate Thread only works for pre-defined keywords in the SwingLibrary package.
By changing the sequence to:
Run Keyword In Separate Thread SelectDialog New Data Group
Run Keyword In Separate Thread Push Button OK
Run Keyword In Separate Thread SelectDialog New Data Group
Run Keyword In Separate Thread Push Button Yes
The RF script now works as expected.

Related

vsCode on Problems panel, items from tasks/problemMatcher -how to remove an item when there is no more error

Using VSCode, I define a Task to compile my code.
Into the task, I define a problemMatcher to catch error(severity=error) or success(severity=info).
When I execute the task, if error match pattern, VSCode report it into a item of Problems Panel.
So, I read my error, place a correction on my code and re-start the task to compile. Now, there is no more error.
BUT how to remove the 'error' item from the Problems Panel ?
Is there a way to define a 'no'problemMatcher ? or a command to remove a item on panel ?
?
so, I found I need to define the problemMatcher.owner with a value (arbitrary).
If omitted, each execution set a different owner to the 'problem' item and then it do not delete previous 'problem' items.
Default 'external' if omitted seems not exact or not complete.
I discover it when I analyze the detail of Problems items (right copy message) from my problems and compare with working tasks/problemMatcher. The main difference was the owner value, unique on mine, same on working tasks/problemMatcher.

Trying to add notifications to a crud operation in list view

I'm trying to add some notifications to the delete operation on one of my cruds, basically to inform the admin that while successful, the model has some lingering relationships that they may want to remove/deal with.
I've tried adding \Alert::add('warning', 'The text of the notification')->flash(); into the delete operation (and this does show up if the page is then refreshed) but isn't shown in the same way the "Item deleted successfully" one is.
The only option I can see is to not use $this->crud->delete($id); and build out all the functionality there on my own.
I also had a similar situation to you. What I did is, First I have written my condition in destroy function I have created if and in else conditions in if my conditional logic and in else "$this->crud->delete($id)". In my code, if the condition is not met then I have simply return a boolean('true|false') in the form of a string and catch that as result in "resources/views/vendor/backpack/crud/buttons/delete.blade.php" and make your custom notification in if condition.

How can I create a Hierarchical block with GNURadio Companion?

I am trying to create a Hierarchical block using the GNURadio Companion GUI. Answers I've found in other posts say to select the blocks you want to incorporate, then go to More -> Create Hier. Then a new screen is supposed to appear. However, doing "Create Hier" with any combinations of blocks selected seems to do nothing.
Am I doing something wrong, or is there a problem with my GRC?
It's very simple. You just start with a new flow graph in GRC, and use Pad Sources as input, and Pad Sinks as output.
If you want to let the user configure something, use a Parameter GRC block.
You must set the Generate Options in the Options block to Hier Block, and set a sensible ID there, too – don't stick with top_block, but use something (without spaces or -; it needs to work as a python name) that won't conflict with something else.
Here's an example:
You can then Generate button (or press [F5]), and then, after you've done a rescan of your block library with the refresh button you can find (and use) your new block in the Block Category you specified.

Workaround for saving / editing a VSTS test case

I have an issue with VSTS manual test cases. When I try to edit one, I got an error message as follows:
An element with the same key already exists in the dictionary
e</n.prototype.add#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:3:2142
ki</n.prototype.onAddParameterInSteps#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:46195
bi</n.prototype.onAddParameterInSteps#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:40049
tf</t.prototype.onAddParameterInSteps#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:62452
bi</n.prototype._updateParametersRefCountOnAddingStep/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:39659
.each#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:12291
bi</n.prototype._updateParametersRefCountOnAddingStep#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:39614
bi</n.prototype._calculateParameterRefCountsFromSteps#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:40691
bi</n.prototype.setParameters#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:35794
yt</t.prototype.readParameters#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async135478241-v-UPjjKxU6f1kHHOWlhqz1Q==:14:58274
yt</t.prototype._onStepsLoaded#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async135478241-v-UPjjKxU6f1kHHOWlhqz1Q==:14:72430
o/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:53:215
u#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async135478241-v-UPjjKxU6f1kHHOWlhqz1Q==:14:81038
yt</t.prototype._fetch#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async135478241-v-UPjjKxU6f1kHHOWlhqz1Q==:14:81408
yt</t.prototype.invalidate#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async135478241-v-UPjjKxU6f1kHHOWlhqz1Q==:14:57579
c</n.prototype._onFieldChanged#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async636480634-vHvWOSM8E8rCxBa3bYo2R7w==:149:2040
o/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:53:215
u#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:94:177
o</n.prototype.invokeHandlers#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:94:526
tr</n.prototype.fireEvent#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:100720
tr</n.prototype.fireFieldChange#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:103810
tr</n.prototype.evaluateFields#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:112953
tr</n.prototype.evaluate#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:112662
tr</n.prototype._takeUpdateResult#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:110218
vi</t.prototype._beginSaveWorkItemsInternal/</</<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:74066
vi</t.prototype.beginGetWorkItemTypeExtensions#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:69585
vi</t.prototype._beginSaveWorkItemsInternal/</<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:74001
.each#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:12291
vi</t.prototype._beginSaveWorkItemsInternal/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:73876
rt#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:59:938
l/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:59:1252
i.Callbacks/l#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:35816
i.Callbacks/s.fireWith#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:36641
w#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:73448
.send/t/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:79367
Session Id: 73288d72-580f-42fb-9aeb-f5cadb6b3bc5
I only have this issue if a test step contains parameters. After refreshing the page and reopening the test case, the color code is black and it doesn't display the Save button. Also, the dropdown of the ... is empty.
Existing tests are fine, running them is also possible. Working with bugs, user stories and tasks is fine.
Screenshots can be found here
Is there a way to workaround this?
This is caused by the parameter name "#length", remove it or rename it to others like "#length1" would works.
This seems to be a bug with VSTS, I have help you created a feedback on MS Connect Page, refer to this link for details: "An element with the same key already exists in the dictionary" error occurs when save a test case contains a parameter named as "length".

VSTO Word add-in - new document event not firing if Word is launched from the executable

In my add-in, I need to create a task pane for each open document. In the add-in's startup method, I subscribe to the ApplicationEvents4_Event.NewDocument and Application.DocumentOpen events, and then create a task pane for each opened document:
((ApplicationEvents4_Event)Application).NewDocument += CreateTaskPaneWrapper;
Application.DocumentOpen += CreateTaskPaneWrapper;
foreach (Document document in Application.Documents)
{
CreateTaskPaneWrapper(document);
}
This covers cases for opening or creating a document through Word's menu, or opening an existing document file in the OS. However, if Word is already opened, launching WINWORD.EXE (or accessing it through a shortcut, which is a pretty common scenario) doesn't trigger either event, despite a new window with a new document being opened. How can I react to this scenario and create a task pane for a document created this way? I'm using VSTO 3 and Visual Studio 2008, targeting Word 2007.
If Word is started, a new document is created BEFORE the Add-In loads, therefore this event can not be trapped.
If you need to work with the initially created document, just take a look at the Documents collection - if Count is greater zero, this document is the one created by Word before your Add-In was loaded.
So I solved this problem in my solution, although I'm not sure it will be cross applicable. Sadly, mine is in VB.Net, so there may need to be some translation.
First, I ended up not using ApplicationEvents4_Event Instead there are other built in event triggers you can use via "ThisAddIn"
Private Sub Application_NewDocument(ByVal Doc As Word.Document) Handles Application.NewDocument
'MsgBox("I opened something")
myCustomTaskPane = Me.CustomTaskPanes.Add(New MyCustomTaskPaneClass, "TaskPane", Doc.ActiveWindow)
myCustomTaskPane.Visible = True
End Sub
Using this method I did have a similar challenge. Running winword.exe, and thereby opening a new word document, did not trigger the NewDocument event. Luckily, there was another event to use - Document change.
Private Sub Application_DocumentChange() Handles Application.DocumentChange
'function to test if the ActiveDocument has a taskpane from my add-in, and then a function to add one
If Not HasMyCustomTaskPane() then AddCustomTaskPane()
End Sub
So - bottom line, regardless of if you keep using ApplicationEvents4_Event you should see if you can use the DocumentChange event. It triggers when a new word window is selected.
Handling task panes for more than one window in Word is fairly complicated, because of how Word loads and re-uses open windows. To do it correctly, you have to consider different actions:
The user takes an action to display or hide a task pane.
The user creates a new document.
The user opens an existing document.
The user closes an open document.
There's a tutorial that explores all the details, both in VB and C#: https://msdn.microsoft.com/en-us/library/bb264456%28v=office.12%29.aspx
I also found a similar answer on SO.