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.
Related
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.
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.
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.
Background: I'm writing a script to collect some files in to a zip file. This script might be used in several operation system. The issue is that I don't what do they(the OS's) support? Linux has a build-in ZIP (on most distributions). Windows is a bit of a mess in this perspective. Since the zip command is not distrusted with the OS
Two issues:
1) I'm looking for a ZIP utility to be my scripts meat and bones, without actually implementing my own zip. Something with a unified command line style. (Java based perhaps?) If you know one, it will help me a lot to complete my task.
2) Right now I'm using some oracle client zip.exe for my windows machine to test my script. I've notice that I don't see the files inside of my newly created archive. Browsing around the web tells me that this has to do with windows being "blind". Preferably, any utility will solve that. Any ideas on why does this happen?
In the and I wrote a litle program in Java that does the ziping. I would publish the code but it's closed source. Since java was assumed in my system combined with the strong zip power it was the solution.
Is it possible to test a webpage which supports an export mechanism? This export mechanism streams the data displayed in a table via xml to the user. For now it's sufficient to test if the streaming works and the user receives a file, regardless of the file content. Any ideas how I can achieve this with selenium?
I googled around for a while, and according to selenium core FAQ, u may need to use firefox template to do that.
u may take a look of this:
http://oopsnullpointer.wordpress.com/2011/01/14/selenium-handling-testing-downloads-with-a-custom-profile/
I have not yet personally tested that though.
If you're using Selenium script by itself, this would be hard, if not impossible. Luckily, you can run selenium from Java, C# and more and have it integrate with JUnit, NUnit or your favorite unit testing framework. If you use one of these languages, you could use it to cause selenium to export the file to a specific location, then use C#/Java to actually go out on the file system and verify that the file was correctly exported to the location, and do any other validation on it.
For doing this development, you can typically find all the client libraries under the bin directory of Selenium server. If you're using Selenium IDE, you can even export your test cases to C#, Java, Ruby, or whatever else, or just use it as an example to manually write your own in code.
Hope that helps!