how to identify path for android using appium - appium

This is for iOS to find all the elements:
driver.findElementsByXPath("//UIAApplication[1]/UIAWindow[1]/UIACollectionView[1]/UIACollectionCell");
I need the similar path for android, I tried:
driver.findElementsByXPath("//android.view.View[1]/android.widget.GridView[1]")
But it's not working. Please help

Please post the log from Appium console, so that we will be able to find out the exact issue.
From :
//android.view.View[1]/android.widget.GridView[1]
It seems there are multiple GridViews are available on that particular screen. Please try to put some constraints.
e.g
//android.view.View[#id='Id_of_the_View']/android.widget.GridView[#something here too]

If you are on a native application, just use the inspector or hierarchy viewer to get the Xpath but I would advise you use driver.findElement(s)ById to get specific elements. Hope this helps.
If you could give a bit more detail maybe I could help.

If you are using Eclipse as editor, then you can open an emulator where you have the app installed, then open DDMS perspective from Eclipse.
Go into your app at the view you want to inspect, and then click the button Dump View Hierarchy for UI Automator in the DDMS perspective.
This will give you a snapshot and you can hover over elements and find their properties.

Related

Reveal.js does not load in ios9.3

My old iPad (ios9.3) refuses to load any reveal.js slides. It only shows the "Fork me on Github" image on the top corner. I suppose it will be that ios 9.3 does not support some new features of html5+js+css (I am not a developer, my skills are quite limited, so please excuse me if I say something stupid).
I am very interested in using it on an iPad due to the chalkboard plugin.
Any of you know what can be causing the trouble? Could I disable any of these features/files and make it work?
Thank you.
aimar
During all this weekend I was trying to figure out a solution. Finally, I manage to debug iOS safari from my windows laptop following this procedure and found that an "Unexpected identifier" was impeding "chalkboard" plugin to load.
A variable was defined with "let" command that, as I learnt, was not recognized by safari 9. I changed 4 "let"s with 4 "var"s commands in "plugin.js" (chalkboard plugin) and now it works in my old iPad, even with reveal v4.
Now I have another issue with the menus (menu plugin) not showing properly, but I will try also to fix it.

Get `.uix` file using Java package

When we take a screen capture of a mobile device using the Appium app, We get a screenshot image file and a .uix file. Which can be viewed in the Appium software. I'm running an automation test and am currently taking the screenshot on failure, to know where the test fails. But sometimes the elements seem to be present in the screenshot. So it wud be helpful if I could get the .uix file too by using some API. So that I can view them in the Appium software to know what failure has exactly happened.
I found a discussion thread here which does exactly what you need. Check it out and give it a try and let us know here if that approach works.

How can a Microsoft Edge content script be debugged?

Microsoft has some decent documentation on debugging Content Scripts for an Edge Extension and the top of the page even includes a Channel 9 video on the subject.
Unfortunately, the techniques no longer seem to work, as even when following the debug instructions and using the the sample Text Swap extension, the extension and content script never show up in the debugger.
As you can see from the screenshot, the content script has run (and changed the font on the page) but it and the extension itself are nowhere to be seen in the debugger.
Anyone figured out how to get the content script to show up in the debugger?
You can see below screenshot. I have the css under "extension" folder" and js under "no domain" folder. I hope you have the manifest file correct. Looks like your console have errors. you can check check it and correct if necessary.
enter link description here
It appears that the debugger is not consistent in loading the extensions. The script is running, however, the debugger does not always show the extension and the content script.
This is what I have done to ensure visibility of the content script:
Close all open Edge windows.
Launch Edge
Wait for prompt about extensions from unknown sources being turned
off and select 'Turn on anyway.'
Navigate to the URL to debug. In this case it is:
https://developer.microsoft.com/en-us/
Open the debugger (F12)
Right click on the Extension's Icon on the top right of the browser,
to the right of the address bar.
Select 'Manage' and then 'Reload extension.'
Refresh the page.
I was having the same issue. The solution which helped in my case is so obvious that it's nearly embarrassing...:
I mistakenly alsways pressed F12 in any arbitrary tab. That brought up the developer tools for the site that was opened in that particular tab. Just as Ken describes his issue.
Now what helps to get the developer tools for the extension to be debugged, is following the instructions listed in the docs here:https://learn.microsoft.com/en-us/microsoft-edge/extensions/guides/debugging-extensions#background-script-debugging
You simply have to click the Background page link. Then you'll be able to debug your extension.
This was a bug that has been fixed in an upcoming version, see https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/13829248/ for details.

How to automate mac app using Xcode?

I try to add UI test cases to our existing mac application. I already tried UI test cases for iOS, which includes the following steps
I choosed Appium instead of Apple's UIAutomator, because I want to maintain the same flow for our Android apps too.
To proceed the automation, I need to set Labels/Values/Identifiers to the elements. So that they can be accessible. We used drawRect method in most parts, so I followed this post to make drawed components accessible.
I can set/read elements in iOS. What I did is, whenever I draw an element, I simply created an UIAccessibilityElement and added in the corresponding view.
Now, I'm trying to write UI tests for our mac application. As Appium does not have support to the mac application, I considered to use Apple's XCTest UI recording/playback to automate my mac application.
Here is the steps that I took:
NSAccessibility is the class that provides accessibility to the mac application
With XCTest, If I knew a particular elements (say a button) identifier/label, I can proceed with automated tap action
Unlike UIAccessibility, NSAccessibility is a role based object. That is, we need to mention which type of accessibility element that we are going to define.
To start the automation process, I took my mac applications left panel, which has five buttons aligned vertically in it
I set identifiers to those buttons. Then I opened Accessibility Inspector and opened my mac app. The values are properly set.
Then I tried to use record option in XCTest. When tapping the button, crashes the app with the error
"Recorder Service Error: Left Mouse Down: Failed to find matching
element".
I posted about it here.
Questions:
Can someone suggest me the right path to automate mac application? Am I going in the right way?
I googled a lot to see a working sample code about how to implement NSAccessibility. But I can not found anything. Can someone share any useful links/samples?
All I need is, to get elements by identifier/label. Accessibility Inspector shows the right value where as XCTest can not read the identifiers. Did anyone face this issue?
Thanks in Advance

Simulate Mouseclick-Events on a jailbroken device via cycript

I'm interested in the iOS-Tweak "MouseSupport" Source Code (Repo) from Matthias Ringwald. Does anybody know how to use it?
I would like to simulate Mouseclick-Events while being hooked up at SpringBoard (via cycript)
(a goal would be for example to click programmatically on buttons or just simulate a click at a specific point via coordinates).
Thx
Regarding your goals; take a look at cocoawithlove.com or check out the Private Framework Header repo by masbogs on Github.

Resources