WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

Driver find_element by By.NAME returns wrong value instead of WebElement

Open bwomsm1 opened this issue 3 years ago • 14 comments

When I am calling to:

res = driver.find_element(By.NAME, 'my_text')

res object looks as follow:

 "{'ELEMENT': '42.1312000'}"

And missing the whole object methods like click, ...

bwomsm1 avatar Aug 15 '22 08:08 bwomsm1

@anunay1 do you mind checking this ticket? Many Thanks!

bwomsm1 avatar Aug 15 '22 08:08 bwomsm1

Can you share the full code?

anunay1 avatar Aug 15 '22 08:08 anunay1

When I reaches the webdriver lib it's:

return self.execute(RemoteCommand.FIND_ELEMENT, {'using': by, 'value': value})['value']

while by is name and value is System

bwomsm1 avatar Aug 15 '22 09:08 bwomsm1

Or in other words its

self.driver_.find_element(By.NAME, 'System')

bwomsm1 avatar Aug 15 '22 09:08 bwomsm1

there is some issue with your library referencing. check project settings.

anunay1 avatar Aug 15 '22 09:08 anunay1

@anunay1 I tried deleting the PyCharm .idea files, tried running the script from CLI but nothing helped, I currently have only 1 python version installed on my computer.

bwomsm1 avatar Aug 15 '22 09:08 bwomsm1

call?

anunay1 avatar Aug 15 '22 09:08 anunay1

Sure thx: https://stanleyblackanddecker.zoom.us/j/93295646663

bwomsm1 avatar Aug 15 '22 09:08 bwomsm1

Hi @anunay1 , After downgrading to selenium 3.141.0 and reinstalling Python-Appium-Client version 2.1.4, I started getting this error: 'WebDriver' object has no attribute 'w3c'

I cannot find any place on my code that can point that.

Do you have an idea?

Thanks!

bwomsm1 avatar Aug 22 '22 07:08 bwomsm1

Add forceMjsonwp true as capability.please check with both the values true and false.

anunay1 avatar Aug 22 '22 08:08 anunay1

@anunay1 I tried both true and false, it did not help.

bwomsm1 avatar Aug 22 '22 08:08 bwomsm1

When forceMjsonwp is true:

{"capabilities": {"alwaysMatch": {"appium:app": "C:\\AeroScoutEngineManager\\bin\\Rte\\EngineManager.exe", "appium:winAppDriverHost": "127.0.0.1:4723", "platformName": "Windows", "appium:platformVersion": "10", "appium:automationName": "Windows", "appium:forceMjsonwp": true, "appium:appArguments": "ShellLayout.xml ShellCnf.xml", "appium:appWorkingDir": "c:\\AeroScoutEngineManager\\bin\\Rte"}, "firstMatch": [{}]}, "desiredCapabilities": {"app": "C:\\AeroScoutEngineManager\\bin\\Rte\\EngineManager.exe", "winAppDriverHost": "127.0.0.1:4723", "platformName": "Windows", "platformVersion": "10", "automationName": "Windows", "forceMjsonwp": true, "appArguments": "ShellLayout.xml ShellCnf.xml", "appWorkingDir": "c:\\AeroScoutEngineManager\\bin\\Rte"}}

bwomsm1 avatar Aug 22 '22 08:08 bwomsm1

Are you getting this issue in touch actions.

anunay1 avatar Aug 22 '22 09:08 anunay1

@anunay1 I managed to progress with that issue, and managed to launch the test and run. With the python libraries as showing above. So as for issue of this ticket I think that it is solved.

The issue which I am still facing is that after launch, I am trying to do this:

self.driver_.implicitly_wait(1)

and then I get the error,

that implicitly_wait is going to some use of w3c member which is not defined.

bwomsm1 avatar Aug 22 '22 10:08 bwomsm1