Not able to select option from dropdown box in an android mobile application - python-2.7

I have to automate payment gateway process for my native android application for which i have to select option from dropdowon box. After selecting an option "continue" button will be enabled.
On clicking continue button it takes me to new screen where payment details will be entered.
I'm facing following issues:
1) Not able to select drop down menu option after scrolling in the drop drown.
2) Able to select the option from first 5 options which are visible when dropdwon opens without any scrolling.after the option selection continue button has to be enabled by defalut.i am able to see that option got selected but not able to click on continue button.Script is not returning any error but i am sure it is not clicking on continue button.
Before clicking on dropdown id and class of dropdown are packagename;id/statechooser and android.widget.spinner respectively.
After click on dropdown id and class are android:id/text1 and android.widget.Textview.
Below is my code.
#entering Name
self.driver.find_element_by_id('packagename:id/name').send_keys('App Test');
self.driver.keyevent(66)
#entering address line 1
self.driver.find_element_by_id('packagename:id/address_line_1').send_keys('Madison Boulevard')
self.driver.keyevent(66)
self.driver.find_element_by_id('packagename;id/city').send_keys('Madison');
self.driver.find_element_by_id('packagename;id/zip').send_keys('25758');
self.driver.keyevent(66)(#this event for moving to dropdown)
self.driver.keyevent(66)(#this event for opening dropdown)
self.driver.find_element_by_xpath("//android.widget.TextView[#text='Alabama']").click()
self.driver.find_element_by_id('packagename:id/continue_button').click();

Finally I got solution for this. By using python wrapper for UIAUTOMATOR I am able to proceed to next page.I am using down method until the option is visible and then pressing enter to accept it instead of click method. Below is the code.
while(self.d(resourceId="android:id/text1").text!='Hawaii'):
self.d.press('down');
self.d.press('enter')

Related

How to set "Start without debugging" in VS in topbar

How can I set "Start without debugging " in the top-bar of the Visual Studio 2019 IDE, instead of "Local Windows Debugger". I find it annoying that every single time I need to press CTRL + F5 to start without debugging.
I looked through settings but I didn't see anything. Maybe I missed something.
You can add virtually any command to the VS-2019 IDE's toolbars. At the right-hand side of the tooolbar where you want your command to go, click the small down-arrow and select the "Add or Remove Buttons" command from the pop-up:
Then, if the command you want is not shown in the list of 'available' buttons, select the "Customize" command (near the bottom). Then, in the pop-up box, click the "Add Command" button:
In the next pop-up, for the "Start Without Debugging" command, you have to (odd though it may seem) select the "Debug" category from the left-hand list and scroll down (some way) in the right-hand list to find it:
Once selected, click "OK" ad "Close" the first pop-up. The command button will now appear (probably at the extreme left-hand side) on the toolbar.
Right click on the toolbar, pick Customize from the drop down menu
Click the Commands tab in the dialog that appears
Click the Toolbar radio button
Pick the 'Standard' option from the drop down menu to the right of the Toolbar button
Click the Add Command button
Click the Debug category on the left
Scroll down to list on the right to find the 'Start without Debugging' command and select it.
Click OK
etc. etc.

how to pop up a new form window withing the opened window on clicking a new add item button in sharepoint

Hello I am using SP 2013 online and on the my main page, I have a button "Add new item" Like this
When I click it, it open a new form and replace the current window which I don't want. So right now it behaves this way:
What I want is: that when I click on the button it pop up the new form window above the opened window. This pic shows the desired behavior.
How can I achieve this in SharePoint? I am a new user of SharePoint. Please help me to figure it out.
thanks in advance.
There is an option in custom lists to launch forms as a pop up or dialog box as you've displayed.
To get this to happen:
You can always try > List Settings > Advanced Settings > Launch forms in a dialog? Yes
Just be aware that if a user has pop up blockers set on their browser it may open up in the window (your first screen shot) or not at all.
See if that helps.

Can I dynamically change the label of a Siebel button?

In our Siebel 7.8 (high interactivity) application, we have a form applet with a Pause / Resume custom button which does the following, depending on the current record's status:
If the status is "queued" or "active", it switches it to "paused".
If the status is "paused", it switches it back to whatever it was before.
If the status is another one ("completed", "error", etc), the button is disabled.
Is it possible to change the label dynamically? So that it would read Pause in the first case, and Resume in the second.
Off the top of my head the only way I can think of doing this would be with a browser script placed both in the Applet_Load and Applet_ChangeRecord events, something like:
var button = this.FindActiveXControl("Name Of My Button Control");
var status = this.BusComp().GetFieldValue("Status");
if (status == "paused") {
button.innerHTML = "Resume";
} else if ((status == "queued") || (status == "active")) {
button.innerHTML = "Pause";
} else {
// the button will be disabled via PreCanInvokeMethod, but we hide it too
button.style.visibility = "hidden";
}
Even if that worked (it should, but I haven't tried it)... I really hate browser scripts in Siebel, they always bring more trouble than solutions. Besides, I still would have to deal with changing the label when the button is clicked too... maybe checking the Applet_InvokeMethod browser event as well.
Is there any way of changing a button's label, based on the current record data, without coding1? All I have found searching online is this trick to change the applet label based on a calculated field, but nothing for buttons.
1: By without coding, I mean not coding the label change myself. It would be perfectly fine if I have to write a business service method to be invoked by Siebel somehow.
There are a few options potentially available:
We did something similar, but we are in a later Siebel version with Open UI. So instead of Browser Script we added code to custom Presentation Model and Physical Renderer JavaScript files. Even though you don't wish to, if you had to resort to something similar using Browser Scripts, you might prefer this over manipulating the text of one button.
I created two button controls: One that displayed Tag and the other Untag. They both call the same method. I added a flag field to the BC. (You might could do the same with a calculated field that is based on certain [Status] values.) In the JS files I put code to check that flag field and then, based on the flag field value, display one button and hide the other.
I did not start with Siebel until 8.1, so I cannot recall if this would be available in 7.8. And this only works on Order Management Applets with a class of CSSSWEFrameListHC (which is why I said "potentially available" options):
There exists an Applet User Property called Hide Control n [See Siebel Developer's Reference v7.8 -> Ch 4: User Properties -> Setting Numbered Instances of a User Property for the use of n in User Properties.]
First, create two separate controls - one that displays Pause and the other Resume. The User Property could be used something like this:
Applet User Properties
Name Value
Hide Control 'Name Of My Pause Button Control', '[Status] = "paused"'
Hide Control 1 'Name Of My Resume Button Control', '[Status] = "queued" OR [Status] = "active"'
You could possibly OR all the other [Status] values into these if you wanted to hide it and not just disable it.
Use Toggle Applets. [See Configuring Siebel eBusiness Applications v7.7 -> Ch 13: Configuring Screens and Views -> Example of Configuring Applet Toggles.]
Copy your existing Applet that has Resume, and modify that button Control in the copy to display Pause. Name the new Applet something like My Form Applet - Pause Button.
Then in Tools drill into your existing Applet, click the Applet Toggle child object, add a New Record, and make it something like this:
If you want this to toggle immediately when the [Status] changes, you'll need to set Immediate Post Changes to TRUE on the [Status] field on the BC. (This could cause performance issues, so be mindful.) Otherwise the Applet won't toggle until the record is saved.
Or you could possibly create a calculated flag field on the BC based on [Status] values, set it's Immediate Post Changes to TRUE, and base the Applet Toggle on that field.
DISCLAIMER: Other than our version of #1, I have not attempted any of these.

MFC radio button group message handler

I've got two little questions at Visual Studio MFC-GUI programming technique regarding the handling of a group of radio buttons in VS2015 CE.
I have a little dialog based application. This application draws some lines on my dialog with a specified pen.
Now I made a group of radio buttons to be able do use different colors for the pen. So I created a group box, placed the radio buttons into this group box, enabled the group property of the first radio button and checked the tab sequence so that all of the radio buttons are properly in sequence.
That's ok - testing the GUI I'm able to select just one of the radio button as planned, because I wouldn't be able to draw a line in to different colors at the same time. Now I added an handler for the BN_CLICKED Message of the first radio button object in the ClassWizard to add the selection of different colored pens.
Now comes the interesting part. This handler is executed only when i click the first radio button. The one with group property enabled. I thought it should be executed whenever I click any of the radio buttons in this group. The next thing I tried was to add an BN_CLICKED-Messagehandler to all of those radio buttons, but the ClassWizard does not shows the BN_CLICKED Message for the other radio buttons - only for the one with group proerty enabled.
After googling around I read a post that one would be able to add an BN_CLICKED-Messagehandler for an button by simply double clicking it in the Dialog. So I double clicked all of my radio buttons and added an invocation of the BN_CLICKED-Messagehandler of the first radio button. That's working as a workaround so that now my line is drawn in the different colors whenever I click on any of those radio buttons (black, blue, red , and so on).
I have two questions - is this behaviour intended? I suppose the reason why I'm only able to add a BN_CLICKED-Messagehandler in the ClassWizard for the first radio button is, that it would be invoked by any of the radio buttons in my group, wouldn't it?
Another question is, I would have preferred to write the handler once and be able to tell the class wizard to use this particular handler instead of creating a unique handler for each of the buttons. That's independent of this radio buttons. I tested this with a simple application which consists of an assembly of several buttons - which can have their own BN_CLICKED-Messagehandlers attached by the class wizard. When I didn't accept the automatically generated functionname from the wizard and enter the name of my own handlerfunction it simply states that it wouldn't be able to overwrite it. How can I select an existing handler for an object message in the class wizard or is that not possible and I have to do this manually in code for myself?
Hope there's an VS2015 MFC Guy out there be able to tell me ..
This is indeed by design. You could have wanted different behaviour for each button click - if you don;t simply associate all of the BN_CLICKED to the same message handler and delete the ones that were automatically generated.
You can also use ON_CONTROL_RANGE(BN_CLICKED, id1, id2, memberFxn ) - make sure your buttons are in the same range in your resource.h
Hope that helps!

ZK how to remove waiting actions

I have an textbox with onChange method and button to make some actions. But if I type some thing in textbox and not clicking any where , click that button, It calls onClick method and then onChange method.Or first onChange and then OnClick but I should disable all actions after that onChange method.
Add the check to your onClick() method. The onChange() for a text box is fired after a certain period of time or after you deselect your component. If you deselect your component by clicking on a button it sounds pretty natural to me to get the onClik first and then the onChange. There is no way of controlling (as far as I know) these events, except on server side.
Read this !
Keep in mind that you are developing a WEB application and not a Desktop Application. And event if the development of zk applications may look pretty similar to the desktop applications they are not and they have their limitations.
I found solution :
First for Textbox onFocus method I disable next button , and user cant click it.
Second for Textbox onBlure method I enable next button. (To be fired onBlure action user should click somewhere on window or press tab and this fires onChange action)