Appium for iOS: How to verify attributes that changes instantly - ios7

I have a button which has only attribute "value" that changes from null to 1 when it is clicked. But within a fraction of time it restored to value null . During that fraction of time it gets highlighted.
I am retrieving the attribute value and asserting that it is "1" to verify that it is getting selected when tapped on it. But the time when my next command fetches value attribute , it restored to null.
Any work around for this ? Any way to stop appium to load page source after execution of a command or fetching the value attribute at the same time/instantly while clicking the button?

Not that I know of. Maybe your developer could do something for you like value==1 means Clicked, value < 0 means Not Clicked, so on each click it temporarily goes to 1, then to -2, -3, -4...? Or maybe another element on the screen could change when it is clicked, signaling that the button was clicked. Not an elegant solution, I know. Such is automation.

Related

Ionic-Vue hot reload clears out state?

I'm trying to use Ionic-Vue to develop a mobile application. My problem is summarized by two examples. I apologize if I think including any code to illustrate the problem isn't necessary.
Case 1:
I tried making a form which contains say a Log In. I enter data to the input box and then change the submit button text value in code and save it. The page clears out the data in the form which I don't expect.
Case 2:
I tried making a counter that starts from 0 which increments with successive Count Up button presses. However, if I change the button text value of the counter button to Count Up by 1, the counter value resets back to 0 - a behavior which I don't expect.
How to solve this?

How to edit span text with selenium or robot and save it

I have an application where to enter/change values it uses monaco-editor, and values are inside spans, Manually I go and change it, and save it, it gets saved, but when doing with selenium/robotframework via innerText change, it does changes on UI, but as soon as it saves it, it re-sets its value and not saving.
Tried this
self.driver.execute_script('arguments[0].innerHTML = "{}";'.format(value), elem)
but it shows value changed, but doesn't save it.
Please help
You should try to simulate user actions, like with Press Keys.

tabindex not being set when textbox has focus

I have a textbox that when focused it calls an ajax request and populates a list for the user to choose from. Basically just recreated the dropdown using a textbox instead of a select.
The problem is that if I click on the textbox the browser does not recognize the tabindex of the input. Instead it resets its self and starts back at 0. If I tab to the next element tabs work fine, only when I click in the input field to give it focus does it start acting up.
I did notice last night if I put an alert in the page on the focus event that it seems to work. Guessing because the browser focuses on the elememt after I click the ok button.
has anyone heard of this before?
found what was causing the problem. I was calling .blur() on keydown and code was 9 or 13 (Tab/Enter). Not sure why this would give me the problem I was having. I would have just thought the blur event would have executed twice. However I suppose that I was forcing blur on keydown and the current tabindex was not being set. If this is the case then If I needed to I should beable to call blur() onkeyup event.

Dijit DateTextArea Behaviour

I am using the dijit dateTextArea and am experiencing some odd behaviour.
I have a simple form with the Dijit dateTextArea. I am setting a default value for the date and it appears fine. If I click into the date area, select a date and hit submit the date is picked up on the other side fine(i.e. it is submitted). If however I don't touch the dateTextArea (i.e. i don't click into it or give it any focus) and submit the form the date is blank, even though the default date has been set. I've tried setting the default date by setting the value on the widget, the initial value and by using data-dojo-props. The date displays in the field but unless I interact with the field the date does not get submitted.
So, what am I doing wrong? Does the field need focus at some point to work properly?
Is there an extra setting I should be using when specifying a default date?
Thanks
It's difficult to tell what's wrong without seeing some code, but you shouldn't have to focus the input or anything for the value to be submitted.
If you look at the "Net" tab in firebug, is the date value part of the request when you submit the form?
I wasn't able to reproduce the problem in jsfiddle.. http://fiddle.jshell.net/DqHxL/ .
How are you referencing the widgit? Is it with dijit.byId or document.getElementById. If you are using dijits you must use dijit.byId not getElement... Dojo creates shadow objects for everything

Detecting last value of database after refresh the application

I am making an iPad app. I have got some problem. Actually I want to show one view at the starting of the app after launching of splash screen. I have made one checkbox on it. It will work as on/off button. Very first time launching of the app, this screen will show to the user. If user click the off button then this screen will never show to him even after refresfing the app. For it, I have made a database table in which at the starting I have stored 0 value in it. When user click button then it becomes 1. But whenever user will refresh the app it becomes again zero but I want to retrieve the last value from the database. Anyone has idea that how to retrieve last value from database table even after refreshing the app.
Thanks to all.
You really should use user defaults for this purpose. There is a method, registerDefaults that is used to set initial values for a default, but once the user has changed it, that initial value isn't used again on subsequent launches of the app