GithubHelp home page GithubHelp logo

2gis / winium.desktop Goto Github PK

View Code? Open in Web Editor NEW
400.0 92.0 142.0 249 KB

Winium.Desktop is Selenium Remote WebDriver implementation for automated testing of Windows application based on WinFroms and WPF platforms.

License: Mozilla Public License 2.0

C# 97.69% PowerShell 2.31%
webdriver winium windows automation

winium.desktop's Introduction

English description | Описание на русском

Winium for Desktop

Build Status GitHub release ![GitHub license](https://img.shields.io/badge/license-MPL 2.0-blue.svg?style=flat-square)

Winium.Desktop is Selenium Remote WebDriver implementation for automated testing of Windows application based on WinForms and WPF platforms

Winium.Desktop is an open source test automation tool for automated testing of Windows application based on WinForms and WPF platforms.

Supported Platforms

  • WinForms
  • WPF

For Windows Phone 8.1 test automation tool see Windows Phone Driver. For Windows Phone 8 Silverlight test automation tool see Windows Phone Driver.

Why Winium?

You have Selenium WebDriver for testing of web apps, Appium for testing of iOS and Android apps. And now you have Selenium-based tools for testing of Windows apps too. What are some of the benefits? As said by Appium:

  • You can write tests with your favorite dev tools using any WebDriver-compatible language such as Java, Objective-C, JavaScript with Node.js (in promise, callback or generator flavors), PHP, Python, Ruby, C#, Clojure, or Perl with the Selenium WebDriver API and language-specific client libraries.
  • You can use any testing framework.

Requirements

  • Microsoft .NET Framework 4.5.1

Quick Start

  1. Write your tests using you favorite language. In your tests use app desired capability to set path to tested app's exe file. Here is python example:

    # put it in setUp
    self.driver = webdriver.Remote(command_executor='http://localhost:9999',
                                   desired_capabilities={'app': 'C:\\testApp.exe',
                                                         'args': '-port 345'})
    # put it in test method body
    win = self.driver.find_element_by_id('WpfTestApplicationMainWindow')
    win.find_element_by_id('SetTextButton').click()
    assert 'CARAMBA' == self.driver.find_element_by_id('MyTextBox').text
  2. Start Winium.Desktop.Driver.exe (download release from github or build it yourself)

  3. Run your tests and watch the magic happening

How it works

Winium.Desktop.Driver implements Selenium Remote WebDriver and listens for JsonWireProtocol commands. It is responsible for automation of app under test using Winium.Cruciatus.

Contributing

Contributions are welcome!

  1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
  2. Fork the repository to start making your changes to the master branch (or branch off of it).
  3. We recommend to write a test which shows that the bug was fixed or that the feature works as expected.
  4. Send a pull request and bug the maintainer until it gets merged and published. 😃

Contact

Have some questions? Found a bug? Create new issue or contact us at [email protected]

License

Winium is released under the MPL 2.0 license. See LICENSE for details.

winium.desktop's People

Contributors

csharpru avatar kdavydenko avatar lionrouge avatar manoj9788 avatar nickab avatar skyline-gleb avatar stoneman avatar tkurnosova avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

winium.desktop's Issues

Add search pattern to the FindElements

It would be nice to search elements by using search patterns like this: driver.find_elements_by_id('Element_1_*')

and for example with this list:
Element_1_1
Element_1_2
Element_1_3
Element_2_1
Element_2_2

it will return [Element_1_1,Element_1_2,Element_1_3]

Thanks.

finding elements is not consistent

I started automating desktop application developed in .net using Winium desktop.
I observed below issues
1.My application is not in focus (It is not consistent) after opening.For this I found a workaround by getting all the windows and switching from one window another using for loop.
2.I used classname and name locators,Winuim desktop identified the elements only once when run for more than 10 times.It is not consistent in identifying elements.
Please let me know if anything wrong with my code

DesktopOptions options = new DesktopOptions();
options.setApplicationPath("C:\\Program Files (x86)\\Application\\Application.exe");

try {
            WiniumDriver driver = new WiniumDriver(new URL("http://localhost:9999"), options);
Set windows=driver.getWindowHandles();
              Object[] mywindows=windows.toArray();
              for (int i=0;i<mywindows.length;i++)
              {
                  try{
                      driver.switchTo().window(mywindows[i].toString());
                      driver.findElementByClassName("WindowsForms10.EDIT.app.0.1ca0192_r30_ad1").sendKeys("aaa");
                      //driver.findElementByName("txtPassword").sendKeys("aaaa");

                  }catch(Exception E){
                      System.out.println("Not my application");
                  }

              }

Get location on an element

I tried this in python.
I get an exception when I try to get a location on a UI element.
I thought I had posted this yesterday.
Did it get deleted?
sanjeet

v1.3.0 build It contains only the exe file

Hello!
https://yadi.sk/i/c-F3NLW6inmiv
I tried to throw the file in the last assembly, but the launch is still hanging indefinitely.

and You can write an example for all of the items in C # desirable:

Add extended driver commands (see Winium.Elements for bindings). Extended commands simplify usage of following elements:
--ComboBox (collapse, expand, is expanded, find selected item, scroll to item)
--DataGrid (row count, column count, find cell, scroll to cell, select cell)
--ListBox (scroll to item)
---Menu (find item, select item)

Feature: Disable start of application

Hey,

I'm looking for an option to disable the start of an application through the winium desktop driver.
I'm testing a electron application where I don't have to start the application through winium since I have to start the application through chromedriver to pass several command line options. For now I just added the calculator as the app under test but this is not a nice solution. It would be cool to just omit the app path parameter in the capabilities for winium.

Python 3.4.3

Hi,

When run my test with the python version 27 it work fine without any issue in windows 8.1.
if i run the test with python version 34. i am getting error. i was not able to find any element with name or id or class name.

[17:06:18] [Debug] ACCEPTED REQUEST POST /session/AwesomeSession/elements HTTP/1.1
[17:06:18] [Info] COMMAND findElements
{
"sessionId": "AwesomeSession",
"using": "css selector",
"value": ".NetUITextbox",
"SESSIONID": "AwesomeSession"
}
[17:06:18] [Debug] RESPONSE:
NotImplemented: {"sessionId":"AwesomeSession","status":9,"value":"'css selector' is not valid or implemented searching strategy."}
[17:06:18] [Debug] Client closed

[17:06:18] [Debug] Waiting for a connection...

what i need to do work with python 34?

How to configure With Protractor

Hi

How can we configure winium with protractor. What changes do we need to make in config file to work with winium.Desktop.

please help.

Thanks

Support selenium grid

Example:

start Winium.Desktop.Driver.exe --verbose --role node --hub http://localhost:4444/grid/register

Driver.close()/quit() not work

After launching app, even if call driver.close() or driver.quit() it doesn't kill launched app and throw Error: self.driver.quit()
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 483, in quit
self.execute(Command.QUIT)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 201, in execute
self.error_handler.check_response(response)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 181, in check_response
raise exception_class(message, screen, stacktrace)
WebDriverException: Message: Process has exited, so the requested information is not available.

Winium.Desktop driver doesn't click on elements inside a Parallels/VmWare Windows VM

The click operation doesn't seem to be working inside a Parallels Windows VM Machine

I have a VM with Windows 7 installed on my Mac.
I have started the Winium.Desktop.Driver.exe and tried to run some simple steps on several applications, but click doesn't seem to be working correctly.

I have tried the Magic sample with calc.exe (https://github.com/2gis/Winium.Desktop/wiki/Magic-Samples).
It seems that the driver opens the application, but after that, it cannot click on elements from the window.

I have used Inspect and UIAVerify to analyse the properties of the View menu form the calculator, and the results are:

BoundingRectangle: 1340,157,65,38
OR
BoundingRectangle: {l:1340 t:157 r:1405 b:195}

Am I missing something? Do I need to activate the element before clicking on it?

According to the winium.log, it seems that the driver is trying to click correctly on the pair of coordinates of the View menu (1372,175):

09:47:48 [INFO] Click on 'type: ControlType.MenuItem, uid: Item 1, name: View' element at (1372, 175) ClickablePoint

I have ran Winium.Desktop.Driver.exe with --verbose and --log-path parameters, and this is what is displayed:

09:47:47 [DEBUG] ACCEPTED REQUEST POST /session HTTP/1.1
09:47:47 [INFO] COMMAND newSession
{
  "desiredCapabilities": {
    "app": "C:/windows/system32/calc.exe",
    "debugConnectToRunningApp": "false"
  }
}
09:47:47 [DEBUG] Current keyboard simulator: BasedOnInputSimulatorLib
09:47:47 [DEBUG] RESPONSE:
OK: {"sessionId":"AwesomeSession","status":0,"value":{"app":"C:/windows/system32/calc.exe","args":"","debugConnectToRunningApp":false,"innerPort":9998,"keyboardSimulator":1,"launchDelay":0}}
09:47:47 [DEBUG] Client closed

09:47:47 [DEBUG] Waiting for a connection...
09:47:47 [DEBUG] ACCEPTED REQUEST POST /session/AwesomeSession/element HTTP/1.1
09:47:47 [INFO] COMMAND findElement
{
  "using": "class name",
  "sessionId": "AwesomeSession",
  "value": "CalcFrame",
  "SESSIONID": "AwesomeSession"
}
09:47:48 [DEBUG] RESPONSE:
OK: {"sessionId":"AwesomeSession","status":0,"value":{"ELEMENT":"459502-7"}}
09:47:48 [DEBUG] Client closed

09:47:48 [DEBUG] Waiting for a connection...
09:47:48 [DEBUG] ACCEPTED REQUEST POST /session/AwesomeSession/element/459502-7/element HTTP/1.1
09:47:48 [INFO] COMMAND findChildElement
{
  "using": "id",
  "sessionId": "AwesomeSession",
  "id": "459502-7",
  "value": "MenuBar",
  "SESSIONID": "AwesomeSession",
  "ID": "459502-7"
}
09:47:48 [DEBUG] RESPONSE:
OK: {"sessionId":"AwesomeSession","status":0,"value":{"ELEMENT":"4065077-8"}}
09:47:48 [DEBUG] Client closed

09:47:48 [DEBUG] Waiting for a connection...
09:47:48 [DEBUG] ACCEPTED REQUEST POST /session/AwesomeSession/element/4065077-8/element HTTP/1.1
09:47:48 [INFO] COMMAND findChildElement
{
  "using": "name",
  "sessionId": "AwesomeSession",
  "id": "4065077-8",
  "value": "View",
  "SESSIONID": "AwesomeSession",
  "ID": "4065077-8"
}
09:47:48 [DEBUG] RESPONSE:
OK: {"sessionId":"AwesomeSession","status":0,"value":{"ELEMENT":"8130154-9"}}
09:47:48 [DEBUG] Client closed

09:47:48 [DEBUG] Waiting for a connection...
09:47:48 [DEBUG] ACCEPTED REQUEST POST /session/AwesomeSession/element/8130154-9/click HTTP/1.1
09:47:48 [INFO] COMMAND clickElement
{
  "sessionId": "AwesomeSession",
  "id": "8130154-9",
  "SESSIONID": "AwesomeSession",
  "ID": "8130154-9"
}
09:47:48 [INFO] Click on 'type: ControlType.MenuItem, uid: Item 1, name: View' element at (1372, 175) ClickablePoint
09:47:48 [DEBUG] RESPONSE:
OK: {"sessionId":"AwesomeSession","status":0,"value":null}
09:47:48 [DEBUG] Client closed

09:47:48 [DEBUG] Waiting for a connection...
09:47:48 [DEBUG] ACCEPTED REQUEST POST /session/AwesomeSession/element/8130154-9/element HTTP/1.1
09:47:48 [INFO] COMMAND findChildElement
{
  "using": "name",
  "sessionId": "AwesomeSession",
  "id": "8130154-9",
  "value": "Scientific",
  "SESSIONID": "AwesomeSession",
  "ID": "8130154-9"
}
09:47:58 [INFO] Element 'Name: Scientific' not found
09:47:58 [DEBUG] RESPONSE:
OK: {"sessionId":"AwesomeSession","status":7,"value":{"error":"no such element","stacktrace":"   at Winium.Desktop.Driver.CommandExecutors.FindChildElementExecutor.DoImpl()\r\n   at Winium.Desktop.Driver.CommandExecutors.CommandExecutorBase.Do()","message":"Element cannot be found"}}
09:47:58 [DEBUG] Client closed

09:47:58 [DEBUG] Waiting for a connection...

Mouse actions with winium

Hi,

is it possible to do the mouse action like right click & double click?
while performing the right click.. i am getting below log.

Here is the python code..
user = self.driver.find_element_by_name(" Bhargava B - Available - Video Capable SW Test Eng - Automation, 2700 - India ENG")
actionChains = ActionChains(self.driver)
actionChains.context_click(user).perform()

[16:22:17] [Debug] ACCEPTED REQUEST POST /session/AwesomeSession/element HTTP/1.
1
[16:22:17] [Info] COMMAND findElement
{
"using": "name",
"sessionId": "AwesomeSession",
"value": " Bhargava B - Available - Video Capable SW Test Eng - Automation, 2
700 - India ENG",
"SESSIONID": "AwesomeSession"
}
[16:22:18] [Debug] RESPONSE:
OK: {"sessionId":"AwesomeSession","status":0,"value":{"ELEMENT":"986660328-5"}}

[16:22:18] [Debug] Client closed

[16:22:18] [Debug] Waiting for a connection...
[16:22:18] [Debug] ACCEPTED REQUEST POST /session/AwesomeSession/moveto HTTP/1.1

[16:22:18] [Info] COMMAND mouseMoveTo
{
"sessionId": "AwesomeSession",
"element": "986660328-5",
"SESSIONID": "AwesomeSession"
}
[16:22:18] [Debug] RESPONSE:
OK: {"sessionId":"AwesomeSession","status":0,"value":null}
[16:22:18] [Debug] Client closed

[16:22:18] [Debug] Waiting for a connection...
[16:22:18] [Debug] ACCEPTED REQUEST POST /session/AwesomeSession/click HTTP/1.1

[16:22:18] [Info] COMMAND mouseClick
{
"button": 2,
"sessionId": "AwesomeSession",
"SESSIONID": "AwesomeSession"
}
[16:22:18] [Debug] RESPONSE:
OK: {"sessionId":"AwesomeSession","status":0,"value":null}
[16:22:18] [Debug] Client closed

[16:22:18] [Debug] Waiting for a connection...

Winium should always return string when getting bool/int attributes

When, in python, getting attributes like IsOffscreenProperty, IsEnabled, or NativeWindowHandle, returned value is not a string, thus the selenium get_attribute is giving error that .lower() is not available for type

def get_attribute(self, name):
    resp = self._execute(Command.GET_ELEMENT_ATTRIBUTE, {'name': name})
    attributeValue = ''
    if resp['value'] is None:
        attributeValue = None
    else:
        attributeValue = resp['value']
        if name != 'value' and attributeValue.lower() in ('true', 'false'):
            attributeValue = attributeValue.lower()
    return attributeValue

Running with other selenium drivers simultaneously

I've a problem with running winium desktop and appium(android) at the same time. When I try to run tests, the winium driver hangs out, then the error message returns time-out.
Ive tried to run 2 and more appium web drivers and they worked perfectly.

Testing a browser URL opened from a Windows Application

So far i have tested my windows application through winium and now i have a scenario where i need to validate the URL which was opened on a browser from a button on windows application.

Is this currently possible to pass control from Win application to the launched browser using Winium?

Even if not, is there any other work around? Even if i can get just the URL i will open other instance of Selenium webdriver with that URL.

Driver clicks wrong coordinates if non default screen scale is set

Driver clicks into wrong location when non default (100%) screen scale is setup in Appearance and Personalization -> Adjust screen resolution.

  1. Run calc.exe demo with 100% screen scale - works as expected.
  2. Setup screen scale to 150% in Appearance and Personalization -> Adjust screen resolution - driver miss clicks and automation script fails.

Update documentation

Documentation on clear, getText, sendKeys (x2), findElements (x2) and getElementAttribute commands is missing

can I use send_keys

I keep getting exceptions when I try using send_keys on a an edit field.
Sanjeet

Add implementation of window_handle(s)

Implement command window_handle and window_handles.

JSWP documentation:
/session/:sessionId/window_handle
GET /session/:sessionId/window_handle
Retrieve the current window handle.
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{string} The current window handle.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.

/session/:sessionId/window_handles
GET /session/:sessionId/window_handles
Retrieve the list of all window handles available to the session.
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{Array.} A list of window handles.

Add support for InvokePattern.Invoke

Add support for InvokePattern.Invoke, so elements having such pattern can be "clicked"

  • even when off-screen,
  • without moving mouse

self.driver.execute_script("automation: InvokePattern.Invoke", el_to_be_clicked_by_invoke)

Implement GetElementRect

When trying to use .location on element, in python, it raises
{WebDriverException}Message: 'getElementLocation' is not valid or implemeneted command.

In the meatime I can use .get_attribute("BoundingRectangle") as a workaround

Как получить скришот

Использую winium в связке с cucumber + selenium + allureyandex для тестирования net и web приложений.

В результате скриншот пустой

@Attachment(value="{0}", type="image/png")
    public static byte[] makeWiniumScreenshotWindow(String name)
    {
        byte[] screenshot = null;
        screenshot = ((TakesScreenshot) InitDriverWinium.getDriver()).getScreenshotAs(OutputType.BYTES);
        return screenshot;
    }
public static WebDriver getDriver() {
        if (driver == null) {
            try {
                DesiredCapabilities cap = new DesiredCapabilities();
                cap.setCapability("app", "C:\\***-test\\***\\***.exe");
                cap.setCapability("launchDelay", "30");

                driver = new RemoteWebDriver(STATIC_URL, cap);
            } finally {
                Runtime.getRuntime().addShutdownHook(
                        new Thread(new BrowserCleanup()));
            }
        }
        return driver;
    }

Run application with parameters.

Hello, if it possible to start application with parameters, like for instance notepad.exe /P

This code execution causes exception "Path does not exist.":

driver = webdriver.Remote(
command_executor='http://localhost:9999',
desired_capabilities={
"debugConnectToRunningApp": 'false',
"app": r"C:/windows/system32/notepad.exe /P"
})

Get table data using Winium

img
Hi,

I am using UIspy to find the elements in Windows, While automation a tool where I have table in it where UIspy is identifying only table 'Class Name'

Please find attachment for table

ClassName: "NewGrid_t"

table = driver.find_elements_by_class_name("NewGrid_t")
print (table)

result :
selenium.webdriver.remote.webelement.WebElement object at 0x00000000033AC278

for tab in table:
print(tab.text)

Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\Winium\Winium_SAM\Shore_Agent_Manager.py", line 65, in
print(tab.text)
img

Thanks,
Sandeep S K.

Click strategies

Can you help me? Is it possible to use ClickStrategies like Cruciatus does Click(MouseButton.Left, ClickStrategies.BoundingRectangleCenter, true)?

Unknown command recived: http://localhost:9999/wd/hub/session

In grid console

2016-05-05 08:11:33,024 [9602862-13] INFO  RouteServlet         - [SESSION_ATTEMPTED] [usertest] [10.6.33.88] [firefox] [http://10.6.33.88:4444] [1]
2016-05-05 08:11:37,980 [9602862-13] INFO  RouteServlet         - [SESSION_CREATED] [usertest] [10.6.33.88] [firefox] [http://10.6.33.88:4444] [0ec52d59-fc3b-492c-9c82-e2031d40d3c1] [1]
2016-05-05 08:11:41,718 [9602862-16] INFO  RouteServlet         - [SESSION_ATTEMPTED] [usertest] [10.6.33.88] [winium] [http://10.6.2.72:9999] [1]
2016-05-05 08:11:41,726 [9602862-16] ERROR RouteServlet         - [BAD_HUB_JSON] [] [usertest] [10.6.33.88] - winium
2016-05-05 08:11:41,726 [9602862-16] ERROR RouteServlet         - [SESSION_NOT_CREATED] [usertest] [10.6.33.88] [winium]
2016-05-05 08:11:45,561 [9602862-11] INFO  RouteServlet         - [SESSION_ATTEMPTED] [usertest] [10.6.33.88] [winium] [http://10.6.2.72:9999] [1]
2016-05-05 08:11:45,566 [9602862-11] ERROR RouteServlet         - [BAD_HUB_JSON] [] [usertest] [10.6.33.88] - winium
2016-05-05 08:11:45,566 [9602862-11] ERROR RouteServlet         - [SESSION_NOT_CREATED] [usertest] [10.6.33.88] [winium]
2016-05-05 08:11:48,239 [9602862-17] INFO  RouteServlet         - [SESSION_ATTEMPTED] [usertest] [10.6.33.88] [winium] [http://10.6.2.72:9999] [1]
2016-05-05 08:11:48,248 [9602862-17] ERROR RouteServlet         - [BAD_HUB_JSON] [] [usertest] [10.6.33.88] - winium
2016-05-05 08:11:48,248 [9602862-17] ERROR RouteServlet         - [SESSION_NOT_CREATED] [usertest] [10.6.33.88] [winium]
2016-05-05 08:11:51,145 [9602862-10] INFO  RouteServlet         - [SESSION_ATTEMPTED] [usertest] [10.6.33.88] [winium] [http://10.6.2.72:9999] [1]
2016-05-05 08:11:51,150 [9602862-10] ERROR RouteServlet         - [BAD_HUB_JSON] [] [usertest] [10.6.33.88] - winium
2016-05-05 08:11:51,151 [9602862-10] ERROR RouteServlet         - [SESSION_NOT_CREATED] [usertest] [10.6.33.88] [winium]
2016-05-05 08:11:51,790 [9602862-16] INFO  RouteServlet         - [SESSION_ATTEMPTED] [usertest] [10.6.33.88] [winium] [http://10.6.2.72:9999] [1]
2016-05-05 08:11:51,795 [9602862-16] ERROR RouteServlet         - [BAD_HUB_JSON] [] [usertest] [10.6.33.88] - winium
2016-05-05 08:11:51,795 [9602862-16] ERROR RouteServlet         - [SESSION_NOT_CREATED] [usertest] [10.6.33.88] [winium]
2016-05-05 08:11:51,863 [9602862-13] INFO  ProxyServlet         - [SESSION_DELETED] [10.6.33.88] [http://10.6.33.88:4444] [0ec52d59-fc3b-492c-9c82-e2031d40d3c1]

In Winium console

Starting Windows Desktop Driver on port 9999

09:25:59 [DEBUG] Waiting for a connection...
09:27:06 [DEBUG] ACCEPTED REQUEST POST /wd/hub/session HTTP/1.1
09:27:06 [WARN] Unknown command recived: http://localhost:9999/wd/hub/session
09:27:06 [DEBUG] Client closed

Init driver for WINIUM:

DesiredCapabilities cap = new DesiredCapabilities();
        cap.setCapability("app", "C:\***-test\***\****.exe");
        cap.setCapability("launchDelay", 30000);
        cap.setBrowserName("winium");

driver = new RemoteWebDriver(new URL("http://usertest:[email protected]:4444/wd/hub"), cap);

Init driver for Firefox:

DesiredCapabilities cap = new DesiredCapabilities();
        cap.setBrowserName("firefox");

driver = new RemoteWebDriver(new URL("http://usertest:[email protected]:4444/wd/hub"), cap);

Issues in Working with winium.elements.desktop.ComboBox

Hi @NickAb , @skyline-gleb .
Using scrollTo method of winium.elements.desktop.ComboBox gives error "Unsupported Pattern".

How to use scrollTo() method?
I have tried using it in following 3 ways

ComboBoxElement.scrollTo(by.id(""))
ComboBoxElement.scrollTo(by.name(""))
ComboBoxElement.scrollTo(by.xpath(""))

All of these usages of method resulted in error "Unsupported Pattern"

Please guide.

Thanks

Locate elements with Java, XPath and ControlType

Hey,

Is there a possibility to locate an element with XPath and the ControlType of an element?
When I try to locate an element with /*[contains(@Name,'WindowName')] and use the method element.getAttribute("ControlType"); I'll get the following output for the attribute:
{ProgrammaticName=ControlType.Window, Id=50032, LocalizedControlType=window}.

How can I check for ControlType.Window in my XPath query? The query
/*[contains(@ControlType,'ControlType.Window') and contains(@Name,'WindowName')] seems not to work.

Drag and drop action

Could you please implement drag and drop actions for Winium.
At the moment following error occurs when using mouseDown or any other drag and drop commands:

Exception in thread "main" org.openqa.selenium.UnsupportedCommandException: 'mouseDown' is not valid or implemented command. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 8 milliseconds
Build info: version: '2.47.1', revision: 'unknown', time: '2015-07-30 11:02:44'
System info: host: 'USER-20150617RU', ip: '192.168.2.9', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_79'
Session ID: AwesomeSession
Driver info: winium.elements.desktop.WiniumDriver
Capabilities [{debugConnectToRunningApp=false, app=C:\Users\Administrator\AppData\Local\Albelli Fotoboeken\apc.exe, platform=ANY, launchDelay=0, innerPort=9998, args=, keyboardSimulator=1}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:618)
at org.openqa.selenium.remote.RemoteExecuteMethod.execute(RemoteExecuteMethod.java:33)
at org.openqa.selenium.remote.RemoteMouse.mouseDown(RemoteMouse.java:77)
at org.openqa.selenium.interactions.ClickAndHoldAction.perform(ClickAndHoldAction.java:42)
at org.openqa.selenium.interactions.CompositeAction.perform(CompositeAction.java:50)
at com.albumprinter.ApWebUiTest.TestApp.main(TestApp.java:93)

Run tests on isolated desktop session

Currently when tests are running locally you, basically, can not use mouse, keyboard or any apps on desktop as it might interfere with tests, those problems to some extent can affect tests running remotely on CI node. It would be great to introduce ability to isolate test runs from local desktop (in terms of mouse and keyboard interactions).

There is Windows Simulator that can be used to run "isolated" desktop. The article says that

Under the hood the Windows Simulator is a Remote Desktop Session into your local machine.

So we could research using Windows Simulator or Remote Desktop directly for test runs insolation.

Error

Hello, i am getting this error:

File "C:\Python34\lib\json\decoder.py", line 361, in raw_decode
raise ValueError(errmsg("Expecting value", s, err.value)) from None
ValueError: Expecting value: line 1 column 1 (char 0)

every time with this code:

from selenium import webdriver
driver = webdriver.Remote(
command_executor='http://localhost:9999',
desired_capabilities={
"debugConnectToRunningApp": 'false',
"app": r"C:/windows/system32/calc.exe"
})
win = driver.find_element_by_class_name('CalcFrame')
driver.close()

Any suggestion? Thanks.

SendKeys to textbox wpf

Hi,

I created simple wpf application. I only put two textboxes to mainwindow and set their Name property. Now I would like to create test method and over Winium set Text to these two textboxes. I used element1 = driver.FindElementById("tb1.Name") and then element1.SendKeys("Anytext") - this work well. But when I want to do same with second textbox element2 = driver.FindElementById("tb2.Name") and then element2.SendKeys("Anytext"), text is inputed into first textbox instead of second texbox. Do you have idea what can be wrong? We tested this two people over different wpf applications but behavior is same. Thanks a lot for any help. Petr

More detailed explanation

I am aware that Selenium does not work with WinForms by itself.

Would it be possible to get a more detailed explanation of how Winium works with Selenium to be able to test a WinForms app?

Thanks!

Unknown error for isElementDisplayed

Hi,

I am getting Unknown error for isElementDisplayed. this error is inconsistent.

Please find the below log.
[16:12:29] [Debug] Waiting for a connection...
[16:12:31] [Debug] ACCEPTED REQUEST POST /session/AwesomeSession/elements HTTP/1
.1
[16:12:31] [Info] COMMAND findElements
{
"sessionId": "AwesomeSession",
"using": "class name",
"value": "NetUIListViewItem",
"SESSIONID": "AwesomeSession"
}
[16:12:31] [Debug] RESPONSE:
OK: {"sessionId":"AwesomeSession","status":0,"value":[{"ELEMENT":"824816744-14"}
]}
[16:12:31] [Debug] Client closed

[16:12:31] [Debug] Waiting for a connection...
[16:12:31] [Debug] ACCEPTED REQUEST GET /session/AwesomeSession/element/82481674
4-14/displayed HTTP/1.1
[16:12:31] [Info] COMMAND isElementDisplayed
{
"SESSIONID": "AwesomeSession",
"ID": "824816744-14"
}
[16:12:31] [Debug] RESPONSE:
OK: {"sessionId":"AwesomeSession","status":13,"value":"Unknown error: "}
[16:12:31] [Debug] Client closed

[16:12:31] [Debug] Waiting for a connection..

Using XPath

Good day!
When I try to use the XPath raises many questions.
What should be used as a node?
Which operators and how do I apply?

Please supplement the Wiki section more information about the use of XPath.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.