Winium.Desktop icon indicating copy to clipboard operation
Winium.Desktop copied to clipboard

Winium doesn't work properly on Windows 10

Open RomanIovlev opened this issue 7 years ago • 32 comments

For example this simple Windows Calculator test doesn't work on Windows 10 See example here: https://github.com/Supreme85/jdi-desktop-example/blob/master/src/test/java/org/mytests/tests/example/PureWinium.java e.g. winiumTest1()

First click on 7 done correctly but all other clicks misplaced on similar position right-bottom Misplacement depends on left-top app corner position

RomanIovlev avatar Jan 23 '18 15:01 RomanIovlev

Hey Even i was facing the same problem .you have change the screen scaling to 100% then only it works.

vinuthamikkilineni avatar Feb 12 '18 15:02 vinuthamikkilineni

How I can do this programmatically? Can you provide some example? (better in example above) Thanks!

RomanIovlev avatar Feb 12 '18 20:02 RomanIovlev

I am facing similar issue. The screen scaling is 100% and the control is identified using the AutomationID for the WPF application. But while running application the click is not happening on the identified control.

Jyothish77 avatar Feb 26 '18 06:02 Jyothish77

The clicking is working as expected for me after updating the Windows10 OS Version from 1607 to 1709

Jyothish77 avatar Feb 28 '18 04:02 Jyothish77

I have fixed this issue in Winium Crutius code in my local machine. i need to raise a pull request for the same. Now it works on all VMs ,Windows machine without changing your resolution

vinuthamikkilineni avatar Mar 13 '18 08:03 vinuthamikkilineni

I have raised pull request. i will update this thread as soon as it gets merged

vinuthamikkilineni avatar Mar 13 '18 09:03 vinuthamikkilineni

waiting for your reply @vinuthamikkilineni ., please update .

roopaturlapati avatar Apr 03 '18 09:04 roopaturlapati

i have raised the pull request on winium crutius. its says still pending.

vinuthamikkilineni avatar Apr 17 '18 06:04 vinuthamikkilineni

https://github.com/2gis/Winium.Cruciatus/pull/75 is the link for pull request.

vinuthamikkilineni avatar Apr 17 '18 06:04 vinuthamikkilineni

you can pull the code from here https://github.com/vinuthamikkilineni/Winium.Cruciatus. build WiniumCrutius and add it as external reference for Winium desktop driver. It works

vinuthamikkilineni avatar Apr 17 '18 06:04 vinuthamikkilineni

@vinuthamikkilineni still same ;-( Do I need to change resolution settings with your version?

ChaoLiou avatar Jun 20 '18 09:06 ChaoLiou

@ChaoLiou , Nope There is no need of changing resolution settings. Have you build Winium Desktop driver with new Winium Cruciatus.

vinuthamikkilineni avatar Jun 20 '18 09:06 vinuthamikkilineni

I can upload the Winium.Desktop.Driver.exe with all those changes

vinuthamikkilineni avatar Jun 20 '18 09:06 vinuthamikkilineni

Hey guys! Are there any changes here?

Schroet avatar Jul 03 '18 14:07 Schroet

@vinuthamikkilineni Please do so if you're able to <3

ghost avatar Jul 13 '18 19:07 ghost

hey Its working for me. I am using it for our UI Automation

On Sat, Jul 14, 2018 at 1:22 AM, Z [email protected] wrote:

@vinuthamikkilineni https://github.com/vinuthamikkilineni Please do so if you're able to <3

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/2gis/Winium.Desktop/issues/213#issuecomment-404936591, or mute the thread https://github.com/notifications/unsubscribe-auth/AJSpNNwHfoNMjtdyr2goVJLDS4or5GPVks5uGPqVgaJpZM4Rpx-E .

vinuthamikkilineni avatar Jul 14 '18 07:07 vinuthamikkilineni

@vinuthamikkilineni : Could you please upload the exe file with fix ? I am using Windows 10, Even though i gave everything correct ( automation id's for the text boxes ), it is not clicking on it to type, but i noticed mouse movement on the screen do not know why. Hopefully all these are related to scaling issues and your .exe driver will fix it. thank you.

bhaskaralluri avatar Aug 26 '18 23:08 bhaskaralluri

I faced same issue... How I resolved this is I used below lines to start the service .

WiniumDriverService service = new WiniumDriverService.Builder() .usingDriverExecutable(new File(System.getProperty("user.dir")+"\Drivers\Winium.Desktop.Driver-1.6.exe")) .usingPort(9999) .withVerbose(true) .withSilent(false) .buildDesktopService(); service.start(); WiniumDriver driver = new WiniumDriver(service,opt);

After that You need to stop and start the service for each command. it worked like charm for me.

Remember you need to start only one service at a time otherwise you will get socketexception. service.start(); service.start(); is incorrect.

service.start(); service.stop() service.start(); this is correct

e.g." you have already started the service post initialisation so no need to start again driver.findelement(by.id(**)).click(); service.strop();

service.start(); driver.findelement(by.id(**)).click(); service.stop();

ankurb9 avatar Nov 19 '18 06:11 ankurb9

Hello, when I try to automate the calculator, the first click does it right but the rest clicks randomly. Someone has the solution. I have the resolution 100% connected with VGA. Thanks

carlosEnriqueGosalbez avatar Feb 11 '19 12:02 carlosEnriqueGosalbez

I faced same issue... How I resolved this is I used below lines to start the service .

WiniumDriverService service = new WiniumDriverService.Builder() .usingDriverExecutable(new File(System.getProperty("user.dir")+"\Drivers\Winium.Desktop.Driver-1.6.exe")) .usingPort(9999) .withVerbose(true) .withSilent(false) .buildDesktopService(); service.start(); WiniumDriver driver = new WiniumDriver(service,opt);

After that You need to stop and start the service for each command. it worked like charm for me.

Remember you need to start only one service at a time otherwise you will get socketexception. service.start(); service.start(); is incorrect.

service.start(); service.stop() service.start(); this is correct

e.g." you have already started the service post initialisation so no need to start again driver.findelement(by.id(**)).click(); service.strop();

service.start(); driver.findelement(by.id(**)).click(); service.stop();

@vinuthamikkilineni : Could you please upload the exe file with fix ? I am using Windows 10, Even though i gave everything correct ( automation id's for the text boxes ), it is not clicking on it to type, but i noticed mouse movement on the screen do not know why. Hopefully all these are related to scaling issues and your .exe driver will fix it. thank you.

I am attaching a zip file built locally. Please note my pull request is not approved by Winium team . so It cannot be actual released driver

vinuthamikkilineni avatar Feb 11 '19 14:02 vinuthamikkilineni

I faced same issue... How I resolved this is I used below lines to start the service .

WiniumDriverService service = new WiniumDriverService.Builder() .usingDriverExecutable(new File(System.getProperty("user.dir")+"\Drivers\Winium.Desktop.Driver-1.6.exe")) .usingPort(9999) .withVerbose(true) .withSilent(false) .buildDesktopService(); service.start(); WiniumDriver driver = new WiniumDriver(service,opt);

After that You need to stop and start the service for each command. it worked like charm for me.

Remember you need to start only one service at a time otherwise you will get socketexception. service.start(); service.start(); is incorrect.

service.start(); service.stop() service.start(); this is correct

e.g." you have already started the service post initialisation so no need to start again driver.findelement(by.id(**)).click(); service.strop();

service.start(); driver.findelement(by.id(**)).click(); service.stop();

Starting the service and stoping the service for every click means Starting a new connection for every operation that will be heavy on process. It will slowdown your overall performance

vinuthamikkilineni avatar Feb 11 '19 15:02 vinuthamikkilineni

While trying to launch Winium.driver.exe socket exception has occurred. Below is the detailed message.

Starting Windows Desktop Driver on port 9999

15:19:56 [FATAL] Failed to start driver: System.Net.Sockets.SocketException (0x80004005): An attempt was made to access a socket in a way forbidden by its access permissions at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.Bind(EndPoint localEP) at System.Net.Sockets.TcpListener.Start(Int32 backlog) at Winium.Desktop.Driver.Listener.StartListening() at Winium.Desktop.Driver.Program.Main(String[] args)

Unhandled Exception: System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.Bind(EndPoint localEP) at System.Net.Sockets.TcpListener.Start(Int32 backlog) at Winium.Desktop.Driver.Listener.StartListening() at Winium.Desktop.Driver.Program.Main(String[] args)

I am using windows 10 OS. It is just working fine in the system which is running on Windows 7.

Can anyone suggest me to overcome the issue I am facing?

Devil1061 avatar Feb 15 '19 09:02 Devil1061

Its because port 9999 is being used by another process

vinuthamikkilineni avatar Feb 17 '19 16:02 vinuthamikkilineni

Thanks @vinuthamikkilineni, tried running it in different port and it worked.

Devil1061 avatar Feb 17 '19 20:02 Devil1061

Winium.Desktop.Driver.exe.zip

Hi @vinuthamikkilineni I tried using this version of the driver to automate a custom application. However this driver is still giving the same issue as the previous one. It is still identifying and clicking a distance in the right down direction away from the actual position of the element. This driver along with the winium driver from the official site both work fine when zoom setting is set to 150% at 1920x1080 resolution. Yeah its not working for me at 100 % zoom. if u have any suggestions to correct this from the code itself insteadd of manually changing the zoom setting every time, pls help

Shubham12Baid avatar Jun 04 '19 05:06 Shubham12Baid

Same issue. Don't works... p.s.: Winium latest commit was 3 years ago. The project is dead?

v3g3t4x avatar Jun 07 '19 10:06 v3g3t4x

https://github.com/2gis/Winium.Cruciatus/pull/75 here is my pull request link where I made changes. You can take look and build it locally

vinuthamikkilineni avatar Jun 10 '19 15:06 vinuthamikkilineni

Sorry I was busy I ll check it on my local and update if I added wrong build

vinuthamikkilineni avatar Jun 10 '19 15:06 vinuthamikkilineni

I am using winium of version 0.1.0-1, My test cases are failing for desktop application if screen resolution get changed and also if application get minimized, Is there any way around we can handle such cases ?

MumtazRashid avatar Aug 01 '19 13:08 MumtazRashid