I have a Sikuli 2 script which is composed of:
an app.sikuli directory
with a app.py in it
and several Things.png images
Most of this structure was auto generated by SikuliX while I was creating the script. If I have to switch to another method of creating a Sikuli project, please say so, it's new to me.
I want to "share" this script to any other OS (say I wrote it on Linux, and I want to share it with MacOSX, Windows...). And I want this script to be straightforward to execute (the less steps, the less complexity), but I can modify anything before sharing.
I found the snippet from the Git Docs for Sikulix. Let me know if you found any other solutions because I only know of distributing the finished code for running the .exe on machines with the IDE or just Java installed (NOT TO EDIT -- UNLESS ANOTHER IDE IS BEING USED LIKE ECLIPSE WITH SELENIUM)
YT OF SELENIUM SIKULIX INTEGRATION https://www.youtube.com/watch?v=k65uCl42hSg&list=PL2EKpjm0bX4LqPht11MRfu9R1qUOSAZn3
https://sikulix.github.io/docs/scripts/running-scripts
Where and how can a SikuliX script be stored#
When you need to distribute your SikuliX scripts you have two options: zip-file and jar-file, both variants pack the SikuliX script content in one file, which makes distribution easier. Both can run with SikuliX.
The jar-file variant has an option to be packed together with the scripting and SikuliX feature support (self contained), so it might be run on systems only having a valid Java installation.
variant zip-file#
It can be created in the SikuliX IDE with the file menu entry “Export packed source” and gets the ending .skl instead of .sikuli. As such it cannot be reopened for editing nor used for import, it can only be run using SikuliX features on systems having a valid SikuliX setup. In fact it is simply a zip-file, which can be brought back to a .sikuli folder using a zip utility. So be aware, that this variant does not really hide your script content.
variant jar-file#
It can be created in the SikuliX IDE (file menu entry “Export as jar”). It can be run using SikuliX features on systems having a valid SikuliX setup. The script source is contained in compiled form (Java byte code) and hence not visible, even if one accesses the jar content. So this variant gives some level of secrecy for your scripted workflow.
Related
1. Intellij is not able to recognize the Run options in the feature file, while able to run the file using the command-line tool.
getting Nothing here.
2. There is even no option in the right-click menu
3. Steps are identified as not implemented while steps are implemented and executing successfully with behave CLI tool
It is not ideal, since as you say the ideal is to have the appropriate version of IntelliJ. However, a workaround that has saved me in these situations is to select the step I want to go to and use Ctrl+Shift+F to search in the whole project the place where the method is declared.
This command is also useful to know in which Scenarios a certain step is used, because even if you have the Professional version of IntelliJ it only allows you to access from the Scenario to the Step and not the other way around.
I want to be able to distribute my Sikuli script and allow the end user to run the script without installing Sikuli, my only problem at this point is not knowing what dependencies Sikuli needs to run (besides JAVA). With this knowledge I simply want to create a zip file for my user's machines that they can unzip into a folder and run the script.
Assuming you are using SikuliX as a command line script and not the IDE(IDE should probably work same way too. but I have not much experience with it) , you can simply copy the whole SikuliX folder to another PC and it will usually work straight away. As you mentioned yourself, the only requirement is Java.
I am facing a problem. I am good in selenium webdriver. Now i wish to run my datadriven test cases on mac,linux and other machines. my window machine will be my hub. shall i need to copy excel files of my data driven test cases on each machine(say node).?
As mac does not support my xls(not intalled office). Or grid will only fetch data from my machine's xls files and run test on all different mac machines.?
Forget Selenium for a moment, because this is not a Selenium problem.
Your (test) code reads some (.xls) data file. If you move your test code to some remote machine, and it still needs to read the data file, you will probably need to move that file as well.
Regarding your issue about Mac not supporting Excel. I very much doubt that you are using MS-Excel to read the data file. Chances are very good that you are using some kind of library, like Apache-POI, to do this. That library is a Java library. As long as your target machine can run Java, you should be good to go.
Is there a way to export Selenium code into some sort of file I could send to others to use without selenium? Preferably inserting it into some html file or something they wouldn't have to install on their computers. Thank you!
Kind of, depending on what you use currently.
If you use the IDE, then yes. The steps the IDE records are essentially put into a HTML file that it reads. You can just give that HTML file to someone else, have them import it into the IDE and it would pick up from there. This has the dependency that the user must have an FF version supported by the IDE.
If you use the WebDriver, then no. At least not without much work - even just due to the dependencies. For instance, you have the various drivers, that the user would need to have a copy of for the tests to work. You have the language that the tests were coded in, for instance Java - you'd have to ensure the user has Java.
You could package them up into a nice installer - whereby the installer gets the dependencies for the user, but this will be slow, unreliable and totally not worth the time and effort you place into it. Think of it when you are installing large programs - it's also downloading lots of dependencies for that application too. Visual Studio/Eclipse are prime examples, they depend on hundreds of things. So when you install them, they are not just installing the core files, but the things they depend on too. You could replicate the same thing.
In order to run a Selenium test you would need one this too things:
Selenium IDE running on Firefox, in this case you just export as html and import in the other computer
The runtime of the specific language you are using to export (i.e. for jre, .net for C# etc.) plus the selenium-server running
As for your question, I would say there is no way to export a test case into a single file to be executable by itself.
You Can Export your Test Case Or Test Suite in different languages.
If you are using Selenium IDE follow these steps:
After recording your Test Case click on file menu.
Click on Export Test Suite As.
Save this file.
Now you can send this file.
I have been working on firefox add-ons for quite a long time and its been a real headache to use notpad++ for development. Is there any suitable IDE or plug-in for eclipse available.And just like we do **Run on Server" for dynamic web-projects,Is there any way that, I do a change in any of the sorce file and it automatically creates the .xpi file and installs in firefox?
There are a lot of editors or IDEs that could be easily integrated with the SDK to perform basic tasks like running cfx run or cfx xpi. Here's the system that I use:
I have Wladimir Palant's 'Extension Auto Installer' installed in Firefox
I have a script like this in the add-on's root directory:
#!/bin/bash
/path/to/cfx xpi && wget --post-file=filename.xpi http://127.0.0.1:8888/
Every time I want to test the add-on, I just run the script and the xpi is built and installed into Firefox. Most editors will have some capability to bind a shel command like this to a keybinding.
You don't really need IDE to create XPI every time you make a change.
Create a folder with your addon's source code (e.g.
C://addons/myaddon/).
Put a file containing this path to the folder
containing your Firefox addons and call it the same as your addon ID
(e.g. myaddon#domain.com).
In your install.rdf file, add this line: <em:unpack>true</em:unpack>
This way you can just restart the Firefox whenever you want to see the changes. I recommend this addon, it adds a keyboard shortcut Ctrl+Alt+R for quick restart of Firefox (be sure to get the 0.6b2 version, previous versions don't support the keyboard shortcut):
https://addons.mozilla.org/firefox/downloads/file/121516/restart_firefox-0.6b2-fx.xpi?src=dp-btn-devchannel
Also, you will not loose your source code in case you uninstall your addon while testing (this happens when you develop directly in your Firefox addons folder).
As of IDE, for me personally any editor with syntax highlight for XML and JS works just fine. My personal favorites are Aptana (Eclipse based IDE) and Intype (lightweight and extremely fast).