Appium Android - Cant find view on window heirarchy' - java

‘I am writing a test automation script in Appium for Android Application,……….
I have a scenario where I need to access a view that is directly attached to the window (not attached to the activity). Apparently, By.id method tries to find views which are added to the activity’s view hierarchy, which makes sense. Is there a way through which I can access views added to the window directly?

If this view yours, save link to rootView(fe layout) and use layout.findViewbyid().

Related

Android Studio: View who is visible only in preview

I have a simple question. I'm making application in Android Studio and I have got a problem. My application is creating buttons using Java. I want see these buttons in Preview editor, because I want have easier posibility to editing layout. So I made the same buttons in XML, but here is the problem. When I build my app it is showing both buttons! I want see only the buttons creating by Java code and finally here is my question it is possible remove buttons created in XML? I was thinking about tools:.. but I didn't find any usefull tag. Someone have any idea?
You can use tools:visibility="visible" and android:visibility="gone" together, so they show in the preview, but they're gone when the app is running on a device/emulator.
As already mentioned, you use tools:visibility="visible" in combination with android:visibility="gone" to render any view in preview but not in the build.
Using removeView(someChildElement) on your layout will remove the element you don't want. AFAIK, the XML code will still be there in the APK, but it isn't there at all in the built APK.
I have no clue why you want to show them in preview and not in the finished result. If it is because you want to toggle them manually later, you don't need any XML code. You can also do:
someView.setVisibility(GONE)
And a quick reference:
Visible - the view is visible
Invisible - the view is invisible, but still takes up space
Gone - the view is invisible and takes up no space
You cannot remove the code from the XML file on build though.

How can I display a web page in an eclipse view

Iam making a new view plugin for eclipse and I need it to display a website.
I know there are eclipse views already that does that but I haven't found a way to do it. I know it is very simple using a JFrame or similar but how can I get it to show in an eclipse view?
Thank you
You can use an SWT Browser component, as described at http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet128.java -- you would need to add the Browser to the view's composite parent when the view is created.

Unable to click item in android app using Appium xpaths

My Android app is using a clickable GridView with embedded (unclickable) images.
The user is able to select an image and go through to the rest of the app because the underlying implemention has intercepted onClick() at the gridview level which conveniently passes through the ImageView element that was selected.
However, the app crashes when I click the ImageView using Appium/WebDriver.
How can I do this in Appium?
Thanks
Rakesh
so it turns out you can click the unclickable! The reason my app was crashing was because bad xpaths are not dealt with well by Appium.
I was able to get the View object and click it.

Adding views to MuPDFReaderView

I am currently using the MuPDF library from here: http://www.mupdf.com/
I've successfully compiled the library and everything is working great, though I am at a loss on how to achieve the following.
I want to attach views, such as button views, textviews, webviews and imageviews to the MuPDFReaderView. But everytime I try to add the view I fail to get any visible results, I can not see the attached view anywhere and I'm sure it's being added because when I debug it, the code is successfully run.
The reason I want to do this is to overlay views on the PDF view which will then scale and move along with the PDF document.
I ofcourse realise there isn't any code in this question, but I can't really post the entire MuPDF source code here, so here's what I think is relevant in a pastebin:
http://pastebin.com/qJFNsvdV
So yeah, how and where would I attach views to the document so they scale and move with the document properly?
We have a similar feature in our Android customizable magazine app, using muPDF: we add views on top on the pdf view to display slide shows or videos inside a magazine page.
This app is open source and available on Github. It should be easy for you to review the code, and see how we implemented this feature.

Eclipse “Open Call Hierarchy” across the whole working set/workspace

Is there a way to extend the “Open Call Hierarchy” function to the whole working set or workspace? (i.e. across multiple projects)
This would be very handy when searching for deprecated methods and dependencies.
By default Open Call Hierarchy searches in workspace. Click on down arrow in Call Hierarchy view to see Search In... and Search Scope options.
Guide to find down arrow:
In the Call Hierarchy view window from the right there are Maximize, Minimize and View Menu. View Menu is represented by a triangle pointing down and that is what you need to click.

Categories