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

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.

Related

UIAStaticText Appium iOS - NodeJS

I am currently writing Appium automation tests in NodeJS for iOS. Although I am having issues with UIAStaticText elements. Even though they are visible on screen I constantly get ElementNotFound error.
I am using the XPath for the element displayed in Appium Inspector - it is in the format "//UIAApplication/UIAWindow/UIAStaticText[1]" In the app code the element is a UIALabel.
I'm trying to get the value of the label but currently unable to getAttribute but it can't find the element.
Is there a known limitation with UIAStaticText elements and is there a workaround?
Many thanks.
I'm not sure if you are asking how to get an attribute or how to properly find an element. I'll assume find an element.
I'm not sure of any known issues with UIAStaticText but I would try using the following line
driver.findElement(By.xpath("//UIAStaticText[contains(#text, '*Static Text*')]"));
or
driver.findElement(By.xpath("//UIAStaticText[contains(#label, '*label Text*')]"));
This way you are not depending on the previous items within the xpath. A good way to test if you have a good xpath is to use the copy xml button in the appium inspector and see if your xpath returns a unique item.
In most cases I have run into the label matches the name or the text.
Hope that answers your question.

Get version of Service in WMI

I installed a windows service using InstallShields generated msi file.
How am I able to get the version of the service using WMI-Query? I already checked win32_Service but there's no version number displayed. Is this information queryable using WMI or do I have to use the registry for this scenario?
Okay, got it. The information is stored in Win32_Product.

Arrange Cytoscape network windows using the API (Version 3)

I'm developing a bundle app for Cytoscape 3. In this app I need a funcionality very similar to the build-in View > Arrange Network Windows > Grid, or Ctrl+G.
However, I cannot seem to find anything in Cytoscape's API that allows me to arrange network windows.
The source code behind the build-in funcionality can be found here: https://github.com/cytoscape/cytoscape-impl/blob/cbd6ae7202a2137d0224862aa371b82c1ec9a7a7/swing-application-impl/src/main/java/org/cytoscape/internal/view/CyDesktopManager.java#L81
As you can see I need a reference to the JDesktopPane, how do I get this through the API?
I don't think there is clean API-way of achieving what I want. You can however do it as follows:
In your activator you are able to retrieve a CySwingApplication reference: getService(bc, CySwingApplication.class), from which you can call the method .getJFrame(). You can recursively scan through all swing Container components with until you find a component of the type JDesktopPane. When you call .getAllFrames() of the JDesktopPane you can do whatever with you network windows (JInternalFrame).

How to access Webview in appium python for iOS hybrid apps

Tried with
handle = self.driver.window_handles[0]
self.driver.switch_to_window(handle)
on emulator, but no luck. I am not able to access / manipulate the elements in the page. I don't even know if i got switched to web view.
Any suggestions on how to use web views on iOS with appium (python) ?
driver.window_handles[0]is probably the current window - try inspecting window_handles to see what other windows are available. On iOS, the app that I test just has window handles like '1', '2', etc, and switching to the last element of window_handles usually does the trick.
Please use the below code to switch to WebView , if you are using appium 1.0
self.driver.switch_to.context('WEBVIEW');

Launch intellij via URL

Would it be possible to register some protocol
and then launch IntelliJ via an URL. I am
thinking of submitting the URL via Desktop.browse()
from within a JVM.
My idea is that the URL would consists of
a file name parameter and a line number parameter.
And IntelliJ would then open this file name and
scroll to the given line number. Here is an
example:
intellij:/mypath/myfile#99
Has this already been done?
Bye
P.S.:
java.awt.Desktop Class
http://docs.oracle.com/javase/6/docs/api/java/awt/Desktop.html
Check IDEA-65879 for existing workarounds or vote for the issue so that it's available out of the box in the future versions.
One of the suggested solutions is the Remote Call plug-in.
You could use IntelliJ Platform REST API.
Example to check: http://localhost:63342/api/about
Use Postman to send these requests.
For me, it works on IntelliJ Idea but unfortunately, on Android Studio it doesn't work.
Asked this question about it.

Resources