error in adding an updated timestamp with a button - google-app-maker

I have a kiosk app running to check visitors in & out of specific offices. The checkedIn time is generated as an event tied to the model. In the events, I have an onCreate setup to record.checkedIn = new Date ();
The problem I have run into is on the Desk Clerks side of things. They have access to a table listing who is checked in. I want a button in each row that they can click to check out that individual. I setup the button under its onClick property to
record.checkedOut = new Date();
They both use the same datasource. However, whenever I click the button in preview the debug reports:
E
Tue Apr 04 10:14:24 GMT-700 2017
record is not defined
at signInAdmin.Panel1.Table1Panel.Table1.Table1Body.Table1Row.Button1.onClick:1:1

That's probably because 'record' is not defined in the context of onClick.
You should be able to get the record by accessing the data source property of the widget.
Try something like:
widget.datasource.item.checkedOut = new Date();

Related

iOS_Appium_Java-Element is present but click operation is not interactable

We're trying to automate one of our Test cases on iOS (iPad) with appium-java client 8.
The test step is like below:
Fetch element from TextField
Click on that textField
Clear the existing value and enter the new value
Test Result:
We're able to fetch the value from the TextField
Click action is successful but the actual interaction is not working. Due to which the sendkeys also not working
Note: The above scenario was working fine with approach 1 with TestProject. Now we've migrated the framework to appium. After that only it's failing few scenarios
Please review the attached DOMAppium Inspector- Actual Element
Tried Approaches
1. Approach 1
{
element.getAttribute("value");
element.click();
element.sendkeys("newvalue");
}
->
Test Result:
We're able to fetch the value from the TextField
Click action is successful but the actual interaction is not working. Due to which the sendkeys also not working
2. Actions Class
{
Actions action = new Actions(appiumDriver);
WebElement element = appiumDriver.findElement(byLocator);
element.getAttribute("value");
action.moveToElement(element).click().perform();
action.moveToElement(element).sendKeys(Keys.chord(Keys.CONTROL, "a")).perform();
element.clear();
element.sendKeys(""+text);
appiumDriver.hideKeyboard();
}
Test Result:
We're able to fetch the value from the TextField
Click action is successful but the actual interaction is not working. Due to which the sendkeys also not working
3. With W3C action
{
PointerInput FINGER = new PointerInput(PointerInput.Kind.TOUCH, "finger");
Sequence tap = new Sequence(FINGER, 1)
.addAction(FINGER.createPointerMove(Duration.ofMillis(0),PointerInput.Origin.viewport(), (element.getRect().x + (element.getSize().width/2)), element.getRect().y))
.addAction(FINGER.createPointerDown(0))
.addAction(new Pause(FINGER, Duration.ofMillis(200)))
.addAction(FINGER.createPointerUp(0));
appiumDriver.perform(Arrays.asList(tap));
}
Test Result:
We're able to fetch the value from the TextField
Click action is working fine. However it's clicking on different location. Same thing happening when we try to find element in appium inspector. The locator is correct but still the coordinates are different one.
Find element with xpath-Highlighing coordinates

link user parameter "value" into event value in firebase event console

I'm generating an event in my mobile app using this method:
var Param = {};
Param.VALUE = response[1];
firebase.analytics().logEvent(`Purchase_report`, Param);
and I am able to receive the log in StreamView and also Event dashboard. I also can see my parameter("VALUE") by correct sent value from my application in these views. However I don't know how may I link this value to the event value and I always see "0" as event value. Please refer to these images for more clarifications:
I found my answer. The point is if you set a value parameter, it takes about ONE DAY for an update to be appear in the firebase console.So I finally saw my report after one day.

Cannot add new correlated record to new created record

When I create new record in Google AppMaker and then try to add correlated record to this new one I get this warning in console:
com.google.apps.appmaker.client.datasource.AbstractModelDataSource
WARNING: Could not find element with key RecordKey{key=private$7,
model key=...
Both datasources are set to:
Manual save mode
Automatically load data
The problem doesn't appear when I refresh the page or try to add correlated record to other existing record.
Anybody knows what could be a reason for this error?
App Maker doesn't allow to have unsaved changes on both ends of relation, most likely it is a reason, why you recieve error message in the first case. But in theory it should work once you save one of the relation ends (first save one of the records and then link them and save again):
var countryDs = app.datasources.Country;
var capitalDs = app.datasources.Capital;
countryDs.createItem();
countryDs.item.Name = 'United States';
countryDs.saveChanges(function() {
capitalDs.createItem();
capitalDs.item.Name = 'Washington, D.C.';
capitalDs.item.Country = countryDs.item;
capitalDs.saveChanges();
});
OK, I fixed it.
I have two forms. First to create item. Second to edit data. In the first form page need to be set to:
On Detach: Clear Changes To Datasource.
Datasources need to be set to autosave.

How do I track when a user refreshes the page in GTM

I have an application that I manage, that builds transactions for someone to download. The user downloading, may have to wait some time from the moment he/she hits build, till they are able to download. During this time, the page that they are on, auto refreshes about every 3 minutes. We feel that maybe users are manually refreshing as well.
We currently use Google Tag Manager (GTM) on this application and are wanting to track said behavior. Are users refreshing the page over and over again, until the screen shows that the transaction they were waiting for, is ready for them.
For example, this is what I'm hoping to see:
Category: foo-bar
Action**: Auto Refresh
Category: foo-bar
Action: Manual Refresh
There are multiple steps to achieve this.
1) Set up a form of data persistence (e.g. cookie, session storage or localStorage). In this example, I will use a cookie.
2) Save current page to the defined cookie. In this case previousPage.
3) Within the function that automatically reloads the page, include a method of identification that this occurred. In this example I will use a dataLayer push.
4) On the page load develop logic to determine, if the current page equals the previous page AND the dataLayer push (3) is not present.
Specifics:
2) Create a HTML script that fires on every pageload:
<script>
document.cookie = "previousPage= " + {{Page Path}} + "; path=/;";
</script>
Create a new variable called Previous Page.
1st-Party Cookie -> Cookie Name -> previousPage
3) Fire the below dataLayer push prior to GTM loading, if the page is automatically reloaded.
dataLayer.push({'automaticReload' : True})
Create a new variable called Automatic Reload.
Data Layer Variable -> Data Layer Variable Name -> automaticReload
4) Create a new Custom Javascript Variable named Reload:
function(){
if({{Page Path}} == {{Previous Page}}){
return true}
else{
return false}
};
Create two new events.
Event 1: Manual reload
Trigger:
Reload : equals : True
Automatic Reload : does not equal : True
Event 2: Automatic reload
Trigger:
Reload equals True
Automatic Reload equals True

Adding Removing Columns to Datagrid in Flex with States

I was developing an app that in the first state you choose a date range using dataFields then you press a button to go to another state and generate a datagrid showing an employee list and another scrollable datagrid with its columns generated dynamically having the worked hours for every employee in every date.
The step sequence to get the error message is:
You choose a date range for example: from 01/01/2013 to 01/31/2013
You press generate button (The app change the currentState = "EmployeeList" and all is OK)
You press the back button (you return to initial state and all is OK)
If you change the date range having more days than before date range then all is OK
If you change the date range having less days than before date range then next error is reached
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.controls.dataGridClasses::DataGridBase/http://www.adobe.com/2006/flex/mx/internal::columnHeaderWordWrap()
at mx.controls.dataGridClasses::DataGridItemRenderer/validateProperties()
at mx.managers::LayoutManager/validateClient()
at mx.controls.dataGridClasses::DataGridHeader/updateDisplayList()
at mx.core::UIComponent/validateDisplayList()
at mx.managers::LayoutManager/validateDisplayList()
at mx.managers::LayoutManager/doPhasedInstantiation()
at mx.managers::LayoutManager/doPhasedInstantiationCallback()
and if you google it then some results take to visit apache bug reporting site
https://issues.apache.org/jira/browse/FLEX-22108
And there is no more...
But I found how to solve it!
To solve it first of all I was googling a lot and i looks like no one got this error and I discover that is a Flex Bug reported to Apache. And I was analyzing the original code from DataGrid.as and DataGridColumn.as to think about a possible solution and I was making some tests and nothing work.
What I did and I hope it will be useful to someone
when you click the back button, inside the backbutton_clickEventLister() and before currentState="";
I just set columns array to new Array();
protected function bttnBack_clickEventHandler(event:Event) : void {
// This code line solved it
dtGrdWorkedHours.columns = new Array();
// Make sure of code it before state change stament
currentState = "";
}

Resources