I hope everyone is having a most excellent day and any and all help is appreciated.
I am running an automated Selenium Junit4(remote control) test in internet explorer 7. To do this I utilized the following tutorial: http://qtp-help.blogspot.com/2009/07/selenium-handle-dialogs.html.
The test is being run from my springsource ide on my mac and is being executed through my virtual box ( windows xp sp 3 ) to internet explorer 7. When the test is run, following the directions in the tutorial explicitly, when it gets to the step that is marked with an asterisk:
Thread.sleep(2000);
String browser = selenium.getEval("navigator.userAgent");
if(browser.contains("IE")){
System.out.print("Browser= IE "+browser);
* String[] dialog = new String[]{ "Save_Dialog_IE.exe","Download","Save" };
Runtime.getRuntime().exec(dialog);
I get the error: can not find file or directory
If I call the Save_Dialog_IE.exe inside of a command prompt manually the process runs and interaction with the IE7 browser dialogs are successful. But when attempting to call it while executing the selenium test it does not.
The only step in the tutorial I am not sure I did correctly was placing the executable (Save_Dialog_IE.exe in the project directory). I am not sure exactly where in the project to place the file. I placed it in both the root directory of the project as well as the folder in the project where I created the class for the junit test. A little fuzzy as to exactly where it needs to go.
Anybody got any ideas how to make this work? Or even any idea's as to how to interact with IE7 browser dialogs running a selenium test on a mac to a virtual VMware box running windows xp sp3?
The .exe file needs to be in the same directory as from where your program (its own .exe is run). I'm not sure how it works with selenium, but you may just need to do:
1) The .exe file needs to go in the root of your project. Then you have to get its properties, and make sure that the .exe is copied to the project output. Usually this is the /bin/Debug/ (or /Release/) folder, but I'm not sure how that works with selenium.
Or 2) Put the .exe file along with your selenium test application, wherever that is.
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 close the print window that is showing after submit a form. I used AutoIT to create an exe to close the window. It is working fine when running seperately but when I include it in selenium it is not working. Below I showing the code usind in selenium to call the AutoIT exe. Pls anyone sugggest a better alternative or help me to solve this issue
// Close the print Window
Runtime.getRuntime().exec("D:\eclipse-workspace\AutoITFiles\cancelPrintwindow.exe");
Based on your file path I assume you are using Java, do you have the correct AutoIt jar and dll files in your project?
You will need the following files as part of your project:
AutoItX4Java.jar (or other version)
jacob.jar
AuotItX3.dll
AutoItX3_64.dll
I have a W2K8 box running some automation software.
Once of the drivers that I need to load for it adds a dll into a sub-folder of the program (in Program Files (x86)).
When the program tries to load the driver it spits out an error that it can't find the file. The location that it is looking for the file is correct and if I browse to that location the file is definaelty there.
Other drivers that use similar techniology (i.e. dll's in that same folder) are working fine, in that they find there dll and load up.
If I install the software on a XP/Win7/W2k3 OS it all works fine for the driver in question.
Is there something funky that the OS is doing that is not making the file visible to the program. The account that the servive for this program is running under is an admin account, the same account that I am loggedin with on the console.
I am told that the drivers are all C++ based drivers if that makes any difference.
Thats for any leads
Mick
Just off hand, it sounds like a permissions issue. That the application in question doesn't have access to the Program Files folder. Is this something you have checked? If not, I would start there.
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).
I am using selenium to record some tests. We have a save to pdf button on our application that generates the windows open/ save or in firefox the ok/cancel windows pop up,
The issue is that i can;t get selenium to record my ok or cancel action since i think it is not a javascript window?
Does anyone know the command to do that?
thanks
Sadly, it's not possible to interact with such windows at the moment.
A good workaround for saving files dialog is to save the various parameters (local directory, etc) and tell your browser to not prompt for them, so the window won't pop at all.
See http://wiki.openqa.org/display/SEL/Selenium+Core+FAQ#SeleniumCoreFAQ-Whatyoucan%27tdowithSelenium
Create a separate firefox profile(command to open profile manager:-firefox -P) with the settings you want(you can give settings like where to download and save a file of a particular type automatically without prompting) and instruct your server to use that profile using the command : java -jar 'your server ' -firefoxProfileTemplate 'path_for_firefox_profile'