Handling pop-up in android app using Appium - java

i am using Appium(java) to test android app that contains pop-up window ,(pop-up appears after clicking a button..)
the popup compose from :
Framelayout with resource-id : android:id/content
LinearLayout with resource-id :android:id/parentPanel
LinearLayout (contain 2 buttons) with resource-id :android:id/buttonPanel
i want to press 1 of the buttons inside it ...
i tried verity of options that i found on the web , but nothing works

you can use self.driver.find_element_by_name("text to be clicked")

Related

I want to hide top content of webpage in webview

I have webpage but I don't want navigation menu and search box. Can we float the webview container?
How to hide through android-webview?
mWebView.setVisibility(View.GONE); & mWebView.setVisibility(View.VISIBLE);
Do not use INVISIBLE setting.

JavaFX How to get a children (WebView) from a Tab?

I have just started to do things with JavaFX and I'm trying to 'build' an browser. Right now I have a TabPane with two tabs. One tab has a WebView and the other tab is able to add new tabs. Over the TabPane is a Textfield. When I enter an internet adress I want to load a website in the selected Tab.
My Problem is, that I dont know how to get the Webview inside the selected Tab. I was able to get the selected Tab, but I have no Idea how to get the WebView inside it.
int index = TabPane.getSelectionModel().getSelectedIndex();
Tab selectedTab = TabPane.getTabs().get(index);
You could always call selectedTab.getContent(), and then navigate down through the scene graph hierarchy until you get to the right element. E.g. if your tab content is a BorderPane and the WebView is in the center you could do
BorderPane selectedBorderPane = (BorderPane) selectedTab.getContent();
WebView selectedWebView = (WebView) selectedBorderPane.getCenter();
This is pretty ugly code, though, and you'd have to rewrite it any time you changed the layout, which means your application becomes hard to maintain.
A (much) better way would be to create a variable at the appropriate scope (controller for the view that displays the tab pane, or the class that contains it if you're doing the layout in Java) for the current web view:
private WebView currentWebView ;
Then whenever you create a new tab containing a web view, add a listener to the tab's selectedProperty:
Tab tab = new Tab(...);
// ...
WebView webView = new WebView(...);
// ... layout, etc tab content, etc...
tab.selectedProperty().addListener((obs, wasSelected, isNowSelected) -> {
if (isNowSelected) {
currentWebView = webView ;
}
});
Now currentWebView always references the currently displayed web view. (You will also need to initialize it to the first web view displayed at startup.)

acitivity_main.xml error: java.util.Locale.toLanguageTag()

In the activity_main.xml page when i am trying to click on the imageview button and trying to bring it on the phone screen. it doesnt happen. moreover the phone screen has disappeared. I get the following error : java.util.Locale.toLanguageTag()Ljava/lang/String;

JFace Action and ImageDescriptor - I wnt to show image and text

Action myAction= new Action("LABEL", ImageCache.getImageDescriptor("IMAGE"));
This code shows me a button without any text. Instead it only shows the image.
What should I do to display them both side by side?
I tried using setText() and setDescription() and setImageDescriptor() but none helped.
Text is not normally shown for an action in a ToolBar if there is also an image.
If you are adding the Action to the tool bar manager using an ActionContributionItem you can call ActionContributionItem.setMode(ActionContributionItem.MODE_FORCE_TEXT);

opption menu Jelly bean

How will it be possible to have a menu button which call option-menus with the following condistions ( must be ):
App hides the titlebar :
requestWindowFeature(Window.FEATURE_NO_TITLE);
the targetversion in Manifest is set to 16 :
android:targetSdkVersion="16"
Some Infos and researches from my side:
Setting targetSdkVersion="10" shows the menu still in the bottom, which I would like to achieve.
Showing the titlebar shows the menubutton in top ( 3 points icon ) and the menu is also callable. But I need to hide the titlebar.
any hints , suggestions ?
thanks & regards
Andreas
Another option is to use slider menu and have it on left or right. You shouldn't include button on action bar (like facebook), you can open menu after item click or onFling event.
There is nice and easy tutorial that I tried:
http://oodlestechnologies.com/blogs/Facebook-Style-Slide-Menu-In-Android

Categories