-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AutoIt browser throws exception #9
Comments
Please clarify "I did start my selenium grid and hub" as in explain/list out the exact steps you did. AutoItDriver(Server) does not work with Selenium Grid (registering to grid hub as a node), there is a way to do that, but I have not documented it yet, nor have I had the time to verify that works yet. See issue #7 for tips/ideas. So presently, the server.py that you run "is" your Selenium hub + node as a single server/instance. And it does not support regular web browsers, just AutoIt. So if you wanted to integrate testing with AutoIt and a web browser (that is not local e.g. not FirefoxDriver but rather another RemoteWebDriver then you need to run 2+ servers: 1 server.py for AutoIt, and a separate Selenium server for web browser (that can be hub + node or just standalone server). There is no "hub + node" for AutoItDriver currently. If you want to use AutoItDriverServer with Selenium grid, you are own your own for now until I have time, and good luck with that. |
Hi, Step 1 Step 2: |
I want to exactly what u have done in calculator.java. I want to launch an exe and switch over to the the window that gets opened by launching the app. Your help will be of great use to me. |
If you are looking at the specific case of Windows GUI automation with AutoItDriver and not an integrated test (Selenium web browser + AutoIt for something like upload/download files, etc.) then it may be easier to understand taking https://github.com/daluu/AutoItDriverServer/blob/master/sample-code/CalculatorTest.java as an example. For integration with Selenium web browser, it's a bit more trickier/confusing to a novice user. To do what you want to do, these are your steps:
There is no hub/node to launch, instead you launch |
Hi, I followed all the required install steps (as needed) from here: https://github.com/daluu/AutoItDriverServer#quick-start--serverimplementation-notes. But while running the last command python server.py I am getting below error.Please help |
Do you have a 64-bit machine? If so, which version of Python do you have installed? 32-bit or 64-bit? If you run It sounds like AutoIt (AutoItX/COM) is not registered properly. The install should have taken care of it, but if not, you'd have to manually register it. And/or unregister the inappropriate version of AutoIt first (e.g. 32-bit registered on 64-bit system running 64-bit Python). The following SO post shows how to register a 32-bit and 64-bit COM DLL. If you need to unregister first, add/pass the You want to register one of these DLLs depending on whether you're using 32 or 64-bit (it will be based on what Python bit version you have installed). "C:\Program Files (x86)\AutoIt3\AutoItX\AutoItX3.dll" |
If you want to keep it easy, use 32-bit Python so you work with 32-bit AutoIt, even if you have 64-bit machine. I have installed ActivePython 2.7.2.5 32-bit on my Windows 7 64-bit PC. I forget, but my AutoIt was probably already registered by default with the install, but if not, one can always follow the SO post link to register manually. This setup I've described works for me. |
Hey It opens the app but in background in process but does'nt get shown in monitor |
Glad it finally worked. On your question, I haven't tested opening a lot of applications. It just opens it using AutoItX.Run() function, however that works. I know it works for calculator and notepad. If the app exe is a GUI app, it should theoretically show up on the desktop screen, command line executables might behave differently (also depends if it needs command line arguments). Some GUI apps also start up minimized to the desktop, so make sure it's not one of those apps, or you would have to maximize it with It's also possible that apps may open with this server but not become active (covered up by other windows on desktop), so then you would have to specifically switch to the window to bring it into the foreground and make it active for automation. If you see in my sample Calculator demo, I specifically switch to calculator window/app after opening it (in case it isn't the "active" window). Is your app a custom specific proprietary app to test for your company or one that is publicly shareable/available? If public, I can look into it myself. It's good to have additional data points on what apps have problem running via AutoItDriverServer. |
Thanks. Can u pls help..if i want to click an element using xpath..then what would be the syntax is there a different method to write xpath as i read in the below link https://github.com/daluu/AutoItDriverServer/wiki/WebDriver-API-command-support-and-mapping-to-AutoItX-API. Help required |
Do you know how to use AutoIt? AutoItDriverServer is basically a WebDriver interface/API for AutoIt, it isn't a replacement for Selenium WebDriver. As such, AutoIt doesn't recognize hyperlinks the same way Selenium does, and AutoIt is meant to deal with Windows UI app controls, not browser based web content. If you wanted to figure out what the locator value options are for a hyperlink with AutoIt, you'll want to use a tool like Au3Spy or similar UI spy tools to show you the properties of the UI controls (similar to using Firebug, etc. to figure out the XPath/ID/classname of elements). If you need to test a Windows UI app and web HTML content, you'll want to take a look at SeleniumIntegrationTest.java, which shows you how you can do that using 2 WebDriver instances - one for web & one for AutoIt. But this of course won't work if you need connect to an existing browser opened by your Windows app, etc. since Selenium can only open its own browsers, not connect to existing ones that are open - for that you'll need to look into WatiN and other tools that offer that option. FYI, XPath for AutoItDriverServer, as defined in the wiki link you mention maps to REGEXPCLASS in AutoIt. The way you wrote the findElement command is fine. But your XPath value is invalid. You need to read the AutoIt documentation to learn what REGEXPCLASS means & how to use it. |
Hi David Thanks a lot for your responses over the time to my queries on AutoItDriver It will be really great and helpful if you can look below my exact problem I have an application built on *node.js *technology in which the I have attached the sample project for your reference(TestApp.zip).Kindly TestApp.zip Now click on nw.exe. You should see the application like below. I have followed all the instructions mentioned by you on below link https://github.com/daluu/AutoItDriverServer . My AutoIt Driver is running Now when I go to automate the basic test case
I have attached my script for your reference(SampleTest.java).While I will really appreciate your help here. On Tue, Jan 26, 2016 at 12:15 AM, David Luu notifications@github.com
|
Can u pls see the above comment in an email(same has been sent over email). |
I just took a look, what's the intent of your app? I see it's just a binary executable wrapper (built with node.js) that simply launches a version of Chrome preset to load the index.html file in the local directory. What you then test is against the UI defined by index.html within the custom Chrome browser. And since the custom Chrome browser is launched by the executable, it can't be controlled by Selenium WebDriver (i.e. ChromeDriver or RemoteWebDriver). And unfortunately, AutoIt doesn't deal with web/HTML content well. As I mentioned previously, you can use tool like Au3Spy (part of AutoIt installation, called AutoIt Window Info) to see if you can detect any elements and the following screenshot shows there really isn't anything helpful, as you can not specifically locate just the first or last name fields. For what you want to test, you are better off running a web server (or put the test HTML files on a web server) then using Selenium WebDriver (not this AutoItDriverServer) and connecting to http://webServerHostnameOrIpAddress/index.html and then use Selenium to find and type text into the text fields. A simple web server you can use locally comes with Python. Simply open a command prompt, and navigate to the folder with your HTML files, then run this command there for Python 2.x: then just point Selenium (or for manual tests, your browser) to http://localhost:8888/index.html to test. Even if your actual application requirements call for opening the index.html file via nw.exe through the custom Chrome browser, for automation purposes, you don't need to follow the same steps, because it's just web content that is presented to the user. Opening it directly from a regular browser (FF, Chrome, IE, etc.) is the same thing. Like saying I can use an iPhone, Android, or Windows Phone to make a phone call. They're different models/tools, but in the end I'm still doing the same thing, why does it matter which phone I use to make the phone call? So you can just the nw.exe launch file in custom browser part manually instead and what to test after you can automate the Selenium way. So your problem really has nothing to do with AutoIt or AutoItDriverServer. For any more help in this issue, I suggest you post to a Selenium user group or forum, like the official one. You will get better and more responses there as it won't be just me. I've already given you all the help I can. One final note, the index.html file has a "Click here" link to a qatest.html file that was not in the zip file, not that it matters in this discussion. |
Hi,
After configuring all the required steps suggested by you. I get the below error.
org.openqa.selenium.WebDriverException: Error forwarding the new session cannot find : Capabilities [{browserName=AutoIt}]
I have below code in my java file
public void setUp() throws Exception {
capabilities = new DesiredCapabilities();
capabilities.setCapability("browserName", "AutoIt");
driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capabilities);
Pls note:
I did start my selenium grid and hub
The text was updated successfully, but these errors were encountered: