How to move iMacro script to Selenium? - java

We have been using iMacro for our QA Automation, at a recent discussion it was decided to shift to Selenium.
Selenium provides a comparison thus neglected to mention how to migrate scripts to their platform..http://wiki.imacros.net/Selenium
is there any tools available for this purpose?

There is currently no tool that I know of that can help you with this.
There a couple of alternatives for migrating from iMacros to Selenium:
If you have a small amount of scripts re-record them using selenium IDE
If you have a large amount of test you could write a script that can map equivalent commands, you may still need to do some manual clean up but it may at least save you some time.

The easiest way (if you are using firefox) is to select Tools->Selenium IDE. This will open Selenium IDE in a separate window. Use the Imacros sidebar to "play" the script while Selenium IDE is recording. I just did this myself. It works like a charm. Obviously, this won't do any Imacros specific text-scraping, but if your script is a simple set of actions it works fabulously.

Related

Run ImageJ scripts in IntelliJ

I am an average ImageJ user who learnt to write IJ.macro and Groovy by trial and error. I did this mainly using the plain a simple script editor within ImageJ. I recently came up with IntelliJ, an amazing IDE with auto-completion and debugger. With the help of google, I was able to include the ImageJ jars, and pluggings accessible as external libraries/modules so that I can use the mentioned functionalities [by adding the path in File>Project Structure>Libraries>"+">Java>... here I selected the folders with the Jars and plugins of ImageJ].
I am, therefore, optimistic that I could achieve the last step. Rather than writing the code in IntelliJ and run with the ImageJ script tool, I was wondering if it could be possible to run a script (say with Groovy or Jython) directly from IntelliJ. Somethin like calling ImageJ when I click run. Maybe changing the Java Run Environment, or using it as VM.
Before finishing, sorry if I am saying something really odd or non-sense. I am an average Joe learning by trying.
Kind regards,
You might want to have a look at this GitHub project:
https://github.com/haesleinhuepf/run_jython_scripts_from_ide
It explains the steps required to run a script from within the IDE by starting up and using ImageJ. The tutorial focuses on Jython, but is applicable to all supported scripting languages.
In general, questions about ImageJ usage and script development are best asked on the Image.sc forum instead of here on StackOverflow.
I've never used ImageJ, but I guess your question is independent of ImageJ :-)
I you use ImageJ from java, you will have a class with a main method. Just right-click on the class and then "run" on the menu which appeared.
After your program has finished, there is a "run"-icon in the upper left corner of the small window which appeared.
I guess that's already close to running a script.
Groovy would be a better starting point for scripting (since it is partly a scripting language). You can code Groovy with the IntelliJ community edition, but for full support you need the ultimate edition. So I guess the groovy console is only available in the ultimate edition...
All other options I am aware of will not give you the auto-completion and only a poor-man's debugger (println)
Hope that helps
I don't know if people still struggle with this, it is now 3.5 years later, but if you start a script with this:
//# ImagePlus myImp
import ij.ImagePlus
ImagePlus myImp = myImp
You can use both the autocomplete of IntelliJ and the SciJava script parameters. I keep the same script file open in both ImageJ and IntelliJ. After a change in IntelliJ, I go to the script editor to run it. It automatically detects something has changed and will ask to update.
This is a bit of a hassle, but I haven't found how to get IntelliJ to execute the script in a running instance of ImageJ.

Does Selenium Support automate to Desktop Applications [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
i want to use selenium to automate desktop application but desktop applications does not provide locators and elements X path,how can i locate elements in desktop application
No, Using selenium we can automate only web based application. Selenium doesn't provide any way to automate desktop applications. For automating desktop application we can use other tools such as AutoIT.
Refer here for some idea->http://seleniumsimplified.com/2016/01/can-i-use-selenium-webdriver-to-automate-a-windows-desktop-application/
Answering your question straight, No, Selenium doesn't support to automate Desktop Applications.
As you want to use Selenium to automate desktop application, Winium can be the best solution to your needs.
Winium:
Winium is a new open source framework, that’s based on Selenium and consists of 3 parts:
Supports test automation on Windows applications.
Supports test automation on Windows Phone operating system context (home button, notifications bar, toggles etc.)
Supports test automation on Windows Phone applications.
Pros:
In case you are already using Selenium WebDriver and familiar with its API, using Winium is straightforward.
Cons:
As a result of it’s being a new project, few struggles come in the way. Its API still isn’t complete and not on the same maturity level as other tools in this category.
Bottom line:
In case you are considering Winium, my suggestion is to wait until it’s more baked.
Additional Resources:
You can find some more Open Source Test Automation Tools for Desktop Applications here.
You can you below tools :
Winium (https://github.com/2gis/Winium ) for windows desktop automation.
in this case you'd need to use some desktop inspecting tools like UISpy.
benefit of using this would be, you must be aware of methods and calls in selenium, same methods are there in this tool too.
AutoIT : this is less reliable in case your test script does some job on web and later you want to perform something on the desktop. AutoIT script compiles to an exe which can be triggered from the test script BUT remember AutoIT exe/script would start executing from wherever the cursor is located.
I guess you can use AWT classes to do few of the stuff on desktop but it'd incur a lot of time investment in developing the complete flow. (BAD IDEA, don't do that.)
Not very sure but in a few cases, I have seen Sikuli (An image-based automation API) work fine.(have a look on this quick example https://www.guru99.com/sikuli-tutorial.html)
We have different ways to handle desktop application using selenium webdriver.
below are the different real time techniques
AutoIT : AutoIT is the best option to work on window based application
Sikuli : Sikuli is image based automation tool.
for more reference visit below link
https://sqa.stackexchange.com/questions/9254/can-i-use-selenium-to-do-desktop-application-testing
No you can't automate native windows application with selenium.
But still you can achieve it by autoit or sikuli and again these tools are having few limitation on element activities, handling and reporting.
I would recommend you to take a look on RPA tools. which is trending in market now. you can automate any kind of apps like browser,native windows, citrix.
Consider uipath or blue prism.
I agree these are all not opensource but it's deserved to pay. Uipath you can get some trial version try to use it.
Allt the best!!
You can not automate windows windows based application using selenium . Now it depends on whether you want to use open source tools or microsoft tools.
Open source tools :
Auto IT . Its is very fast and its librarry can be integrated with C# or JAva
Microsoft based tools :
Coded UI - its the latest tool which can work for both windows based and web based application.

Sharing browser automation scripts without client side installation

I want to write a browser automation script which can be used by others to perform their mundane tasks easily. For example, a script that will login to a site using provided credentials, select few products ( passed as parameter) and put them into the cart and checkout automatically.
I would like to keep the end-user installation easy and light. Don't want the end user (who is not tech-savy) to download and setup anything.
I had tried Selenium webdriver in Java for this. The script part works perfect for the requirement but asking the end user to install and set up JAVA, etc is not possible.
Would like to know if there is any simple way to achieve this. Preferably an open source solution, but not necessary. Goal is ease of setup and use for the end user.
Can anything similar be done for Android also?

Selenium RC not able to work with downloads popup window

I am new to the selenium RC. I have been working in eclipse to run a simple junit test case to run and download flashplayer from adobe.com.
But the selenium RC is not able to click or even recognise the downloads pop up window. I have been seeing several suggestions in google search but still I am not able to do it.
I have been trying to get the window ID or name of the pop up window to work with it, but still I am not able to do it. I have copied the major function of my code here down below:
public void testPopup() throws Exception
{
selenium.open("http://get.adobe.com/");
selenium.open("/flashplayer/");
selenium.click("id=buttonDownload");
String ids[]=selenium.getAllWindowIds();
for(int i=0;i<ids.length;i++)
System.out.println(ids[i]);
String[] windownames=selenium.getAllWindowNames();
for(int i=0;i<windownames.length;i++)
System.out.println(windownames[i]);
String feedWinId = selenium.getEval("{var windowId; for(var x in selenium.browserbot.openedWindows ) {windowId=x;} }");
System.out.println(feedWinId);
selenium.chooseOkOnNextConfirmation();
selenium.waitForPageToLoad("30000");
}
It will be great if someone can help me out with this.
Thanks
The short answer: you can't.
The longer, but still disappointing answer:
You can't, because no current Selenium implementation supports it. The Selenium people know about it, it's actually nr. 13 in most wanted features in Selenium right now
Selenium RC will never have it because of its technical limitations (It's pure JavaScript. And pure JavaScript can't download and save files.) and it has been deprecated over a year ago. Selenium WebDriver ... well, maybe, in the future. The various things you can try instead:
Rethink whether you really need to download the file. Isn't is ok just to assert that the file exists and can be downloaded by making a HTTP request and seeing that the answer was 200 OK?
Can't you download the file using pure Java after you get it's URL via Selenium? I personally think this is the best way to go.
If you're using WebDriver, there is a great tool for downloading files!
If you're using Firefox, you can set up a clean testing profile that will be configured so that it will download every clicked file into some specified folder. There are addons out there that can help you with it, too. I'm not sure whether Selenium RC supports usign a precreated profile, but Selenium WebDriver definitely does.
If you're using one given browser to do your tests, you can figure out how to download a file "blindly" by pressing buttons blindly. The Robot class can help you with that. You just click the file and then blindly press Enter or whatever keys to download your file into the right place. There is also AutoIt framework which a lot people use for this task.
You can not automate system generate pop-up by using selenium.
For that you have shift over Autoit with selenium.
With the help of this you can records your activities on download pop-up

What is a good GUI tester?

We need a tool to test a set of fairly complex Java applications. The applications are mostly independent client programs or applets communicating with a servlet or apache server at a remote site. Specs:
Runnable on Windows XP, Vista and 7
Parameterizable (Can specify in a script the sequence of buttons to click, text to type in JTextFields and browser address bar etc.)
Can quit or bail out or display a nasty message if the expected window or dialog box doesn't appear
Record the output on the Java Console of browser in a .txt file (IE is sufficient for now) when the application opens a browser window.
While running, I should be able to see it running with folded hands while it would run
for a few minutes
We were thinking of writing an AWTRobot based tool that reads a command file and does this - (don't know how to do #3 or #4 yet - will ask you folks some day how to detect a window on the desktop). Would you suggest an open source tool available to do this? We don't need anything fancy to capture video or screenshots. Thank you, - M.S.
For browser based automated testing you can use Selenuim or you can use WebDriver.
The selenium project is hosted here
If you don't need to test the way the pages are actually rendered by the browser, but instead need to work at the HTTP/HTTPS/etc request level then have a look at JMeter. It has parametrization, dataproviders, graphs, and a proxy component for recording http user sessions.
If you do need browser testing, then, as has already been mentioned, Selenium is probably the best freely available tool. For production I would recommend using Selenium Remote Control server which can be driven by scripts written in Java/Python/C#/Perl/PHP.
To see what tools people use in real production environments, and to do your own research on what is available I recommend www.sqaforums.com.
Have a look at Sikuli
The reason I suggest this is it sounds like you need to test both a Java applet and the content of a native browser (launched from Java, but not itself Java) -- so it's not "Java all the way".
I'm not sure what you mean by criteria 4, though. It is worth noting that as Sukuli works by image analysis, it won't be able to copy text to a text file.
This question is an invitation for sales pitch, don't you think. How about Mercury Quicktest professional ( I believe its HP Quick test now). I do not believe this will be cheap either ( and well its HP, it will probably only work in IE ;)).
Since you want an open source solution, I believe, the most popular option is selenium and yes its a pain to configure sometimes ( like for Flex for example). So you should try Watir.
There is a lot of good buzz around it and when I evaluated it, I loved what I see.Also it does not work for desktop applications, I suggest you try some other solution for that.
(The problem is open source GUI testing tools are not usually all inclusive. If you need one solution to handle all your gui testing needs, then you should check out the more commercial ones like QTP.
I have used IBM Rational Functional Tester. It has everything you need and it's quite easy to learn. The scripting language is either Java or VB.Net so you won't have to worry about learning a language for your tests.
I had some pretty good results with Squish from FrogLogic and didn't break the bank: http://www.froglogic.com/products/
Did you try Squsih - http://www.froglogic.com/products/index.php

Categories

Resources