Using Robotium with a contextual menu - robotium

I'm testing an application with Robotium, and I have a custom listview with checkboxes. When I click on a checkbox it loads a contextual menu giving the user buttons to modify and delete those items.
I can get Robotium to click the checkbox which loads the menu, but for some reason I can't get it to click on the delete button.
I've tried:
solo.clickOnActionBarItem(R.id.menu_delete);
solo.clickOnMenuItem("Delete");
solo.clickOnImageButton(1);
solo.clickOnImage(1);
So far nothing has worked. Is it possibly because I am clicking the button before the menu has popped up? How can I get Robotium to wait?

It's actually very easy, just click on the view by id:
solo.clickOnView(getActivity().findViewById(R.id.menu_edit));

Related

Is there a way to automatically change the selected menu page in a master detail project when the detail changes?

Background:
My project uses the "Master Detail" project from Xamarin.Forms, so it comes equipped with the hamburger menu button in the top left which is supposed to be the main source of navigation throughout the app. However, my app requires the user to go through multiple of those screens without the use of the hamburger menu. But when a user uses my own buttons to change the detail, the hamburger menu still says the user is on the previous page.
For example, a user is on Page A. They click a button outside of the menu which sends them to Page B. The menu will still show Page A.
My Attempt:
I really didn't know where to start, so I tried taking the MenuItemType and passing it through the following function:
// This changes the screen without changing the menu and it works.
((MasterDetailPage)Application.Current.MainPage).Detail = new NavigationPage(new PageB());
// This was my attempt to change the menu.
(Application.Current.MainPage as MenuPage).RootPage.NavigateFromMenu((id)MenuItemType.PageB);
But that returned a Null Reference Exception when run.
I've also tried manually calling the list view associated with the hamburger menu and changing the selectedItem property, but that didn't work either. Is there any way to change the selected menu?
For Clarity:
Since StackOverflow won't let me post a video, here's a link to how the app acts. As you can see, I use the Menu to go to the "About" Page. I click a button on the screen which takes me back to the "Browse" Page. However, when I open the menu, it still says "About" is selected. I can't reselect "About" until the menu moves away, meaning I have to reopen "Browse" despite already being on that screen.
What I'm looking for is a function which will automatically change the selected menu item to "Browse" when I press that button on the "About" Page. The app is currently using a Master Detail Page which has the "Detail" component changing from the About Page to the Browse Page. The menu page is a Content Page which came built with the app beforehand.

I am having trouble while clicking a "Submit An App" button on my application which is present on the Menu bar

I am using the below code for this, this is present inside a frame and this also clicks the button but after button is clicked the control is lost. The possible reason i see is the page lands on same page which extra options after the "Submit An App" button is clicked.
I am using c# to code it. The first line finds the button the second line clicks but go for a timeout. I have seen this behavior fist time not sure how to work it out.
IWebElement field = VelocityDriver.FindElement(By.Id("AppSub"));
SeleniumExtensions.ClickElementAndContinue(field);

Selenium ClickandWait

Using id=incidentsCheckBox gets me an error but when clicking manually it shows up fine. What is the best way of capturing dynamically generated icons (incidentIcons), which pop up when a checkbox is clicked, which if click individually will show a popup data of status?

Unable to find button of dialog in coded ui test

i have ok button on my dialog box and on the top of dialog new dialog is opening which having again ok button while recording it identify the button but when i run coded ui test then it will not identify second ok button and not clicking on it because of it my test get fail...i am using visual studio 12 ultimate.... please help
Thanks in Advance
Use uielements wait methods WaitForControlExist, WaitForControlEnabled and WaitForControlReady before you click when dealing with popups, or any button. It's likely that your tests are trying to click before the popup "ok" button is ready.
uiControl.WaitForControlExist(20000);
uiControl.WaitForControlEnabled(20000);
uiControl.WaitForControlReady(20000);
mouse.click(uiControl);

dojox form uploader button is clickable only on the border, but not on the full button

I am using IE8
I have created dojo button as below
It has displayed button "Select Files".
Problem
When I click on top border of button its working fine. When I click on any other places on button file picker dialogbox is not displaying.
When I right click on button and select zoom in option once, I am able to click on all the coordinates of button(after selecting zoom option, it works similar to html button).
Note: I have used flash for multiple file selection.
Please tell how to make this button work by clicking in any place.
Have you checked if there is other element's borders in front of the button? Try to check with the developer tools option activated on your browser and select "inspect element" (or similar). If another element is detected when you hover over the button, you have your answer.
Apart from that I have no more ideas.