Appium WinAppDriver find element by accessibility - appium

Using Apppium WinAppDriver to automate my Windows application tests.
All working fine, versions:
Selenium 3.14.0
Appium-python-client 2.0.0
My problem is that i have some resources which can not be located using
find_element(By.NAME,"name") because name is empty. I've tried to use accessibility id which should be automation id as presented by inpsect.exe.
But core selenium driver does not support it and i should use "appiumby".
Tried the following:
from appium.webdriver.common.appiumby import
driver.find_element(By=AppiumBy.ACCESSIBILITY_ID,value="Button1").click()
But getting error:
ModuleNotFoundError: no module named "appium.webdriver.common.appiumby"
Also when testing directly in python interactive i can import "appium.webdriver.common", but not "appium.webdriver.common.appiumby".
Any ideas how to get it working ?
Also in the source code found this:
https://github.com/appium/python-client/blob/b70422b67f5254523ed360e1d196df0df04feab4/appium/webdriver/common/appiumby.py
Is deprecated specific to WINDOWS_UI_AUTOMATION only ?
Thanks,

OK, found the answer:
from appium import webdriver
driver.find_element_by_accessibility_id("Button1").click()
And Button1 value was taken from inspect.exe Automation id value of the locator.

Related

Cannot access child elements using xpath in windows desktop application using appium, winapp in C#

Appium version: v1.22.3-4
Winapp version: v1.2.1
Hi,
I am trying access elements in a desktop based app. Finding via ID or Class name works, but somehow its not able read elements when using Xpath.In a specific case, I need to retreive multiple elements which is possible only by Xpath. Has anyone encountered this issue, please let me know.

Pass end point details in Rest Web Service command in Automation Anywhere

In the Rest Webservice Command, I don't see any option to pass a variable in the URI.
We do not want to hard the end point in the script.
As an e.g I will want the script to use different points for dev/stage and prod.
Is there a work around for this.
On building a URI with variables like :
https://$v_hostname$/test-rs-v1/employee/data send request works fine but
bot runs we get an error stating :
Hostname could not be parsed.
Update: That was a bug and fixed on version 11.3.1. You can only achieve that on version 11.3.1 or later.
Reference: https://docs.automationanywhere.com/bundle/enterprise-v11.3/page/topics/release-notes/release-notes-11-3-1.html
Workaround for older versions (If you have experience with C#): Build and test DLLs
The following applies only on version 11.3.1 and later.
Make sure that $v_hostname$ contains a value at the run time, using debugging option or message box command.
I did reproduce the same error by entering a variable that doesn't exist or doesn't have a value, there is no another scenario would reproduce "Hostname could not be parsed".
If the hostname/URL is invalid you will get "The remote name could not be resolved:".
I've tested the REST Web Service command on both community and enterprise editions, and it's working very well.

How do I test my GtkPrintBackend?

I am trying to develop my own GtkPrintBackend ,
taking help from here:
https://mail.gnome.org/archives/desktop-devel-list/2006-December/msg00069.html
I want to test my print backend( by making the print dialog use my backend instead). How do I do that?
That is, how do I make the Print dialog use my backend instead?
Answering my own question here since I figured out a workaround:
I installed jhbuild and built the gtk+ module using jhbuild.
The source code of the corresponding module is downloaded in ~/jhbuild/checkout/<module-name> .
Modify the print backends under ~jhbuild/checkout/gtk+/gtk/modules/printbackends/ directory, and rebuild it (Find instructions to do that here).
Now when you launch a gtk application from the jhbuild shell, it will use the modified backend instead of the system default one.

How to use swagger file locally?

Hi I have a swagger file written for my API and I could not test the paths of my API since I am getting: ERROR Server not found or an error occurred because my paths are all localhost, so how can i use swagger locally? thank you
I found a solution which is using the building from source way in swagger-editor
Assuming you are developing within Visual studio click the green play looking button to build & run your solution , a browser should now pop up. ignore whatever it comes up with and type localhost/swagger and it should provide you with the interface. Let me know what happens or if you require any assistance

hdf viewer on windows for tables created using pyTables?

viTables only seems to work with python 2.5. I have downloaded HDFView, but when I try to open a table I created following this tutorial, I get the following error message:
Failed to open file C:\tutorial.h5
java.io.IOException: Unsupported fileformat - C:\tutorial.h5
Any ideas for getting HDFView to work?
Is there something I need to do when I'm using pyTables from python to make the format more generic?
Any other good HDF viewers?
Btw, I've just discovered PyTables, and I'm really excited about it.
ViTables works for me with python 2.6 on windows. It is supposed also to work with 2.7.
However the version on the official site did not work for me and crashed. In a mailinglist posting I found the link to the berlios ftp server where I got a version that works like a charm.
Have you seen ViTables?
http://vitables.berlios.de/

Resources