How can I add custom option to toolbar in wireshark GUI? - wireshark

I want to create a custom plugin which gets displayed on the tool bar in wireshark GUI. When the user clicks on the new custom option, then the custom lua script should be executed.
How can I achieve this?

Simply go through the following steps:
In your plugin Lua file (which you should make sure Wireshark loads), start by adding a function which does the job you want your plugin to do:
local function runPlugin()
--here your plugin does its job
end
Then you register the runPlugin() function to be launched from the wireshark toolbar:
register_menu("Lua/Launch my plugin", launhing_function, MENU_TOOLS_UNSORTED);
Now when you open Wireshark and click on Tools > Lua > Launch my plugin the runPlugin() function is called.
Hope this helps!

Related

Is there any way to get data from logitech lua log console?

I'm doing some code for my logitech mouse with lua but I can't find any way to communicate with my pc at all. No lib available here so I can't even send smth to cmd, write file, launch .bat and etc. At least I wasn't successful at this.
The only place where you can output some info is the log window. So the title asks main problem of this topic: Is there any way to get data from logitech lua log console?
To run a .bat file from LGS Lua script:
Create a shortcut action
Run 'Logitech Gaming Software' application
Open 'Customise buttons' tab
Select profile
In the left side you will see the 'Commands' pane (list of bindable actions such as keyboard keys, macros, etc), press the big 'plus' sign to add new command.
In the 'Command Editor', select the 'Shortcut' in the left pane
Set the 1st text field 'Name' to RUN_BAT_FILE
Set the 2nd text field 'Enter a shortcut' to your_bat_file.bat
Set the 3rd text field 'Working Directory' to C:\Path\to\folder
Press 'OK' button to close the 'Command Editor'
Now you can:
either bind this action to a mouse button (drag-n-drop action RUN_BAT_FILE from Commands pane to the big picture of the mouse)
or invoke this action from your LGS Lua script by PlayMacro("RUN_BAT_FILE")
Please note that console window will be brought to the front, and your game will switch off fullscreen mode and will lose keyboard focus.
That is a very nasty thing while you're playing.
But you can invoke windowless applications without interfering the game.
To pass a long message from LGS Lua script to external program:
You can send strings by invoking OutputDebugMessage in your LGS script
and receive them in your external program by means of LGS Debug Interceptor.dll.
To pass information from your external program to your LGS Lua script:
The best way I'm aware of is the following:
Your external program can create a .lua-file and your LGS Lua script can execute it and receive the result (a tuple of Lua values returned by this script)
data = dofile[[c:\some_script.lua]]

How to integrate CANOE with Jenkins?

I want to integrate CANOE with Jenkins. Can anybody please tell me how to do that. For now I am able to open CANOE window through Jenkins. But it shows a disclaimer on startup. I want to click on "I accept" button automatically through Jenkins using any command. Can you please tell me how to do that or what is that command?. Is there any other way to click on that button without pressing the key?
CANoe is implemented as a COM-server. Using the COM-interface, you can start CANoe from a script and thus bypass the disclaimer. I have managed to do this either using C# or python with pywin32. The CANoe help-section contains some help on what COM-server commands are available to get you started.
edit:
If CANoe is associated with cfg-files as standard application, you can call the cfg-file directly and have it launch CANoe. That will still require you to manually click the disclaimer dialog though. In a script, such as the one I mentioned earlier, you can create it in such a way that you are able to specify which cfg-file to use as an input parameter. It can also be written so that you can specify certain test-suites containing your CAPL-scripts. It can basically give you access to most CANoe features necessary to run test-suites with different settings. However, I've not tried a lot of them yet.
Unfortunately, none of your examples can be achieved without creating this kind of script.
CANOE simply loads a .cfg configuration file. For jenkins, I am using the Visual Basics script and same triggering into the Jenkins job.
In this was it bypasses the "I accept" and other windows and loads the desired configuration also also using same kind of VB scirpt you can close the application.
'ToStart CANoe_Start.vbs
Set App = CreateObject("CANoe.Application")
dim fso: set fso = CreateObject("Scripting.FileSystemObject")
dim CANoe_config
CANoe_config = fso.BuildPath(fso.GetAbsolutePathName("."), "<target.cfg>")
App.Measurement.Start()
After that you can add the operations in jenkins jobs; to close the same appilcation use :
'ToStop CANoe_Stop.vbs
Set App = CreateObject("CANoe.Application")
App.Quit()
This worked for me. You can call the vbs's over jenkins jobs.

Hp Loadrunner / virtual user generator web click and script alternative

Not sure if iam asking this in the right place, sorry if not!
We currently create scripts through HP Virtual User generator (using the web click and script protocol) to monitor our webapps, we use this as they require JavaScript execution when being monitored. We import these scripts into HP sitescope so we get alerted when they are down.
The issue is after upgrading to loadrunner 12.01 they have removed the web click and script protocol. I have ran the protocol advisor and it advised to use Truclient ajax - IE protocol. I recorded a script using this and it worked great but it looks like this is not supported in sitescope!
Is anyone aware of an alernative to Web click and script that is compatible with sitescope or an alternative to sitescope altogether?
Thanks!
Web virtual user. Recode the JavaScript function you need in C or take advantage of the functions available in LoadRunner to execute your JavaScript "as is"
If you're going to go with Web HTTP, as James suggests, here's the blog post that explains how to integrate JS bits into your script: http://h30499.www3.hp.com/t5/HP-LoadRunner-and-Performance/How-to-use-JavaScript-in-your-HP-LoadRunner-scripts/ba-p/6197321#.VEO-f8ksHRw
They have not removed the click and script protocol. What they've done is rename it to Ajax Click and Script
Ah yes you're right Ajax Click and Script is different from the normal click and script that is no longer available in LR12.
With the Ajax Click & Script have you tried changing the event configuration level? This might help.

Selenium IDE simulate press ENTER for javascript configmation box

I am looking for allready for hours how to do this. So don't tell me to use search function. I know there are many things related.
There is many stuff on the internet and here, but no one works for me.
And I need a solution for Selenium IDE or something intergrated with it (if there is anything). Not RC and not WebDriver etc.
I need to simulate a key for an JavaScript confirmation popup, which has "OK" and "Cancel" buttons.
The problem is that I cannot select anything.
Popup appears when the site is opened. The Website itself is visible in the background, but no element can be selected (Firebug shows nothing as well, empty html(?)).
If I press ENTER key the confirmation box disappear (so it works fine manually).
This example seems good, but I can't find any interface in Selenium IDE to do this:
driver.switchTo().alert().accept();
(from Click in OK button inside an Alert (Selenium IDE))
I have only the following pattern:
Or write the test in html, which uses the "Command", "Target", "Value" pattern.
Appreciate any help.
EDIT1:
With the link provided by Janesh Kodikara
I have found that my problem is:
Selenium IDE will not be able to handle alerts that are within the page's onload() function. It will only be able to handle alerts that are generated after the page has completely loaded.
There is no "onload" function in my website, but the script part which creates the alert is inside html which is called with page (not in any function). This must be the same as "onload", because the alert comes immediately when the website is opened.
Once you have a confirmation box, you must consume it (Click OK or Cancel button)
You can use "chooseOkOnNextConfirmation" command to instruct Selenium IDE to simulate clicking OK button.
See http://www.guru99.com/enhancing-selenium-ide-script.html for more details.
You will not see the Javascript popup when IDE script is run.
Selenium IDE
Command : runScript
target : {window.onbeforeunload=function(e){};}
Command :click
target : xpath of button.
This will work fine but you are not able to see popup.

How to disable autocomplete code statements in code editor?

Every time I type if and press the space bar, Delphi completes it with if True then and a new empty line above.
Is there a way to remove this "autocomplete" feature or at least edit it to not create the new line?
From the Tools | Options | Editor Options | Code Insight menu, deselect the Auto complete check box under Code template completion.
Once you disable template auto complete then you need to manually invoke the template if you want it. Do that with CTRL+J.
That's called a live template, and you can edit the list of live templates in the template window, from the View menu.
Find the template you don't like, select it, and click the "remove template code" button.
Since the default location for the live code templates is C:\Program Files (x86)\Embarcadero\Studio\16.0\ObjRepos\en\Code_Templates (for XE8, similar for other editions), you will need to change the permissions on this directory (and its subdirectories) in order to edit or add live templates. Default permissions do not include write permission to this directory.

Resources