I was asked this question recently(How to handle window based pop ups) and i replied with the traditional answer involving third party tools like Auto It to which the interviewer replied "Selenium has advanced much and this is outdated answer".
Does the new feature in selenium4 "switchTo(WINDOW.TYPE)" cater to above scenario?
Any links/info/explanation is cordially appreciated.
If the popups' content is also window based (like file upload dialog, print dialog), I think that Selenium may not support it, windows application automation library has to be involved like autoit, pywinauto and others.
Related
I am using UI Automation library - TestStack.White to automate a Windows Application, where I utilize Inspect.exe to get the UI Elements from the WinForms. I have had no issues with the Inspect.exe so far except currently I am stuck with an issue in my development machine where the tool started recognizing the "Buttons" as "Pane" and the behavior is same across Visual UIA Verify, TestStack(White). Eventually all the tests are getting failed since it couldn't identify the Buttons (returns Null).
Here's what it looks like now,
[]
Here's what it used to look and it looks in a Fresh VM,
Expected,
[]
Can someone please through some light regarding this behavior or point out what would have gone wrong here ?
Thanks in Advance !
Hmm... It looks like a bug in UIAutomationCore.dll or a target application issue. I think you can't do something with that on client side. But some workarounds are possible. It's still recognized as a class name with BUTTON inside. So it's possible to do some part of your automation with a tool that can support both UI Automation (for complicated controls like WinForms list views etc) and Win32 API (like here, when it has NativeWindowHandle and adequate ClassName).
If you can consider changing the automation tool, one of the options is pywinauto. It can use Win32 API or UI Automation under the hood by your choice. The high level API is almost the same. So you can easily switch between 2 backends for different actions (having 2 different Application objects connected to one target app instance). Getting Started Guide will bring you initial guidance for the core concept.
Can we use Selenium webdriver for automating MS CRM 2015 based application?If not, is there any specific reason for that.
Selenium can automate any part of a web page if it is based on HTML. So if you want to check it, open the CRM web application, open the browser console and confirm if all the elements required for your automation test are based on HTML.
The non-HTML components of a web page cannot be accessed by Selenium. You might want to use Image Based testing tools like Sikuli.
Since there is a duplicated question (Does Selenium suports CRM applications) asked recently, I'll provide my answer here.
I have successfully implemented selenium webdriver automation with Dynamics CRM. The main differences between CRM and other websites are:
Use of iframes. Be sure to switch to the correct frame that contains the element you wish to work on, e.g. driver.switchTo().frame(the_frame_id), or better yet, implicitly wait for the frame by using ExpectedConditions.frameToBeAvailableAndSwitchToIt(by)
As mentioned by others, wait for loading times. But instead of hard sleeps or explicit waits, I found that CRM actually displays nice spinning "Loading..." messages while it's loading. So to wait for the message to go away before performing further actions, I've used ExpectedConditions.invisibilityOfElementLocated(locator_of_loading_dialog); or for some trickier ones where the visibility is driven by a different attribute value other than display, try ExpectedConditions.attributeContains(locator, attribute, value) - e.g ExpectedConditions.attributeContains(By.id("some_id"), "style", "visibility: hidden") .
Other than that, it's just another web site.
Although it will be lot of work CRM being a SPA but you can get your way out. Here is something i answered for a similar question, in order to avoid copying it over please see it here Selenium Automation testing in crm 2015
I am working with Selenium 2.0 and as far I thought, Selenium doesn't really care about the size of your browser. But when I click a dropdown menu, it can't seem to find all the elements not in the view of the browser whereas when its maxed out it can.
I personally thought it crawls through the web script but my observations prove me wrong.
Comments?
Your assumptions about the inner workings of Selenium may have been correct for Selenium RC, which was a JavaScript-based technology used in Selenium 1.0. Being entirely JavaScript-based, however, meant that it was limited to the browser's JavaScript sandbox, which precluded some actions in the browser.
Selenium 2.0 introduced Selenium WebDriver, which is a different paradigm of web automation. WebDriver attempts to model the user experience and actions as closely as possible. Since modeling the user experience dictates certain design and technology choices for interacting with elements, it likely won't work if the browser is minimized, since a user cannot interact with the page while the browser window is minimized.
Incidentally, I'd be surprised if finding the elements was the issue with executing WebDriver code. Interacting with the elements found, like attempting to click on them or send keystrokes to them, I would completely expect that to fail.
I want to automate the application develoepd in silverlight. Can you let me know whether there are any open source tools are available which can be used for automating SilverLight app. Thanks.
We are doing UI testing on a Silverlight application using the UIAutomation API, and it works very nicely.
Project White is a library that sits on top of UIAutomation, and many people find it helpful. I prefer to use the UIAutomation APIs directly - it's really not as hard as you might think, as my tutorial shows.
If you're looking to perform User Interface Automation (UIA) to simulate mouse clicks, keyboard presses, etc. there is no "easy" way to get this today.
I've seen some third party tools that may work, such as Telerik's. Note that I have not used and do not endorse this, just know it is out there!
I am currently trying out Project White and finding it quite easy to use.
Before using Project White I tried out WiPFlash which was also rather easy to use. It just lacked a few features that I was after (Right Click and Drag options).
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
Are there any tools out there which uses Image Recognition(searching, comparing, validating images) as base for automating and testing GUI software.I know ranorex supports it. Are there any better tools?Are there any gotchas in using Image Recognition to drive test automation?
Ok, first of all, I DO understand the previous answers: testing apps using image recognition isn't the best way to test GUIs. But, at the same time, I don't understand why you aren't answering the question in first place. He's asking for tools that work that way, I'd think he's smart enough to understand where he's going into.
Ok, now the main subject, my choice would includes:
Sikuli, a MIT project under the GNU-like MIT license. It uses Python over Jython. Free.
TestPlant eggPlant, a tool that works through a VNC server, so you can test apps in any VNC compatible platform (including smartphones). It has some nice features like OCR, test schedule and so on. It uses SenseTalk. Not free, you could request a trial.
Routine Bot, I've never used it but it seems pretty useful.
I would also discourage using Image Recognition with SendKeys and Click at Coordinates or (Button Images) to do UI testing. I have been recently using UI Automation to automate the testing of a WPF application with success. By placing small breadcrumbs (Automation.AutomationID="OkButton") throughout our application's XAML I have been able to write some C# Unit Tests that exercise different aspects of the application. Even without the breadcrumbs UI Automation is still capable of exercising an application, but it is slightly more difficult when trying to identify the controls on the UI.
A decent article on Code Project is available as a starting point.
http://www.codeproject.com/KB/WPF/UIAutomation.aspx
You will also need UI Spy, a free tool from Microsoft, which helps you find controls and manually exercise the controls through UI Automation as guidance for writing the scripts. The tool is buried in the Windows Vista SDK, after installation search for UISpy.exe. The UI Spy tool can still run on a Windows XP machine by just copying the EXE to the target machine.
Consider AutoItScript for driving Windows-based GUIs in test scenarios - AND scraping off the UIs. Consider tesseract open source optical character recognition. Also OpenCV for machine vision.
Free AutoItScript works at the API level in that you can read states of various Widgets and Windows sections, send actions to these UI components too, wait for state changes etc. It's possible to produce highly robust automation code that will ensure focusing on Windows and resolution independence.
Let me suggestion another solution.
It's not a complete UI automation framework, but rather a specific tool just for the Image validation.
It will allow you to ignore the unstable part of your images as well (random data, etc.)
It will integrate with any other UI testing framework you choose:Selenium, Sikuli, etc.
http://visualci.com
thanks for your comment! please Take a look at RoutineBot – interface testing software based clicking on certain image patterns and see for yourself how this idea is implemented in an
automation tool!
Old question, but perhaps this answer may prove useful to someone. I currently am using two products,
Testing Anywhere, by Automation Anywhere (http://www.automationanywhere.com/Testing/)
and Quick Test Professional, by HP (http://www8.hp.com/us/en/software-solutions/software.html?compURI=1172957#.UhJBwpLW5-k)
Both of them do the job well enough, and both support the use of image recognition. I am not entirely convinced that image recognition is in itself a bad thing. As with all things, you have to tailor your approach to your particular needs and use the right tool for the job.
Just thought I'd add another entry to this thread. Things may have changed, not sure, but when I last saw the demo, this product offered Sikuli-like IDE/interface/capabilities while being a commercial product and supported actual devices beyond simulator. Don't know if the tool has improved to detect objects by identifiers beyond images now or not.
SeeTest from http://experitest.com