Appium: Unable to perform click on a "+" button - appium

I am trying to automate a mobile app, and I am having issues in trying to click a "+" to add new line of data.
From getsource(), the code for the element is
<android.widget.ImageButton index="0" package="mobi.littlebytes.android.bloodglucosetracker" class="android.widget.ImageButton" text="" resource-id="mobi.littlebytes.android.bloodglucosetracker:id/fab" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[844,1558][1038,1752]" displayed="true" />
</android.widget.RelativeLayout>
and my failed code is
a.moveToElement(driver_App.findElement(By.xpath("//[#id='fab']"))).click().build().perform();
I have also tried
a.moveToElement(driver_App.findElement(By.xpath("//*[#id='mobi.littlebytes.android.bloodglucosetracker:id/fab']"))).click().build().perform();
but failed as well, that is, couldn't get to click the "+" button. Hope to have advice.
I attached the image of the button

Try clicking the element by using the xpath:
driver_App.findElement(By.xpath("//*[#resource-id='mobi.littlebytes.android.bloodglucosetracker:id/fab']")).click();

Related

Implementation and change request tab in requirement work item

In TFS 2010 a requirement work item had also an implementation and a change request tab.
In TFS 2012 the requirement work item also had an implementation and change request tab as written in the documentation, but the picture of a newly created requirement doesn't show anymore these tabs.
Now, in TFS 2015 those two tabse aren't mentioned any more, though the CMMI process shows the work item hierachy as
Epic > Feature > Requirement > Task
I am missing the implementation and change request tab in the standard configuration the CMMI project, because they are very useful in tracking the whole work from defining the features down to the requirements and their implementation with testing as well as subsequent change requests.
Are there any ways to get back these tabs in the standard configuration? I don't like to change the predefined work item types, because you never now what happens with next upgrades of TFS.
I had to go back all the way to 2010 to find the tab definitions you're missing. You can't "configure" TFS to show additional tabs without changing the process definition. To add them back in you have two options.
Create a custom template.
Patch the Requirement form definition after project creation.
The latter option should work well in combination with the way exiting process templates are "upgraded" using the Feature Activation Wizard, though with the new Work Item Form's and the new way Process template customization is done on Visual Studio Team Services, it would not surprise me when the next version of TFS will require manual intervention after upgrade.
1. Create a custom template
Download the CMMI process template from TFS using Visual Studio, update the process template definition (ProcessTemplate.xml) file and give it a new name and GUID:
Then go to the WorkItem Tracking\TypeDefinitions folder and edit the Requirement.xml. Add the two old tabs and link controls back in:
<Tab Label="Implementation">
<Control Type="LinksControl" Name="HierarchyForm" LabelPosition="Top">
<LinksControlOptions>
<WorkItemLinkFilters FilterType="include">
<Filter LinkType="System.LinkTypes.Hierarchy" />
</WorkItemLinkFilters>
<WorkItemTypeFilters FilterType="include">
<Filter WorkItemType="Requirement" />
<Filter WorkItemType="Task" />
</WorkItemTypeFilters>
<ExternalLinkFilters FilterType="excludeAll" />
<LinkColumns>
<LinkColumn RefName="System.ID" />
<LinkColumn RefName="System.WorkItemType" />
<LinkColumn RefName="System.Title" />
<LinkColumn RefName="System.AssignedTo" />
<LinkColumn RefName="System.State" />
<LinkColumn LinkAttribute="System.Links.Comment" />
</LinkColumns>
</LinksControlOptions>
</Control>
</Tab>
<Tab Label="Change Requests">
<Control Type="LinksControl" Name="ChangeRequestsForm" LabelPosition="Top">
<LinksControlOptions>
<WorkItemLinkFilters FilterType="include">
<Filter LinkType="Microsoft.VSTS.Common.Affects" FilterOn="reversename" />
</WorkItemLinkFilters>
<WorkItemTypeFilters FilterType="include">
<Filter WorkItemType="Change Request" />
</WorkItemTypeFilters>
<ExternalLinkFilters FilterType="excludeAll" />
<LinkColumns>
<LinkColumn RefName="System.ID" />
<LinkColumn RefName="System.WorkItemType" />
<LinkColumn RefName="System.Title" />
<LinkColumn RefName="System.AssignedTo" />
<LinkColumn RefName="System.State" />
<LinkColumn LinkAttribute="System.Links.Comment" />
</LinkColumns>
</LinksControlOptions>
</Control>
</Tab>
Upload the custom process template using Visual Studio and create your new Team Projects using that template.
2. Update existing Projects
Use witadmin to export the definition for the requirement work item type from an existing project:
witadmin exportwitd /collection https://server/tfs/DefaultCollection /p MyProject
/n Requirement /f Requirement.xml
Edit the XML file using your favorite text editor (I use Visual Studio Code) and add the above mentioned XML snippet back in. Now that you have a definition for Requirement with the right layout, you can push it to existing projects. First, validate your changes:
witadmin importwitd /collection https://server/tfs/DefaultCollection /v
/f Requirement.xml
If no errors are found, import the definition:
witadmin importwitd /collection https://server/tfs/DefaultCollection /p MyProject
/f Requirement.xml

the display result of tiled map is wrong (using cocos2d-x 3.6)

this is what I created in my TiledMap Editor:
But when I try to display it in simulator, it becomes this:
You can see some of tile images are missed, some are wrong(the place where dirt.png should be become wall.png instead). I don't know why this happened. I follow the tutorial and add the following code in the HelloWorld project.
// create a TMX map
auto map = TMXTiledMap::create("tile/test.tmx");
addChild(map);
the content of test.tmx:
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="orthogonal" renderorder="right-down" width="10" height="10" tilewidth="36" tileheight="36" nextobjectid="5">
<tileset firstgid="1" name="test" tilewidth="36" tileheight="36">
<tile id="0">
<image width="36" height="36" source="dirt.png"/>
</tile>
<tile id="1">
<image width="36" height="36" source="floor.png"/>
</tile>
<tile id="2">
<image width="36" height="36" source="wall.png"/>
</tile>
</tileset>
<layer name="Tile Layer 1" width="10" height="10">
<data encoding="base64" compression="gzip">
H4sIAAAAAAAAA2NkYGBgRMMwgM7GhRnQaEJmMaCJ4zILXS8+dbjsxOY+XO4g5FZ0M0GAiQBGV49PDwgAAKCoyOyQAQAA
</data>
</layer>
<objectgroup name="Object Layer 1">
<object id="1" name="SpawnPoint" x="125" y="133" width="67" height="62"/>
</objectgroup>
</map>
Could any one give me a hand?
okay... I have found why....
There are limitations which cocos2d-x support Tied Map Editor.
in this page, http://www.cocos2d-x.org/wiki/TileMap, it says:
Tiles:
- Embedded tiles are NOT supported (i.e., tilesets with embedded images).
- Only embedded tilesets are supported (i.e., the tileset is embedded, but not its images).
- supports at most 1 tileset per layer.
So.... each of tilesets MUST only contain one image.
And... each of layer MUST only contain one tilesets.
If you don't follow the rule while editing map in the Tied Map Editor. The result will become chaos like mine.

Not getting Execute Code First Migration according to publishprofilesetting

I am getting strange behavior while publishing(Web Deploy) MVC project with Code First Migration.
Publish File code is :
<PublishDatabaseSettings>
<Objects xmlns="">
<ObjectGroup Name="DefaultConnection" Order="1" Enabled="True">
<Destination Path="Data Source=abc.def.com;Initial Catalog=TestDB;Persist Security Info=True;User ID=user;Password=is123" />
<Object Type="DbCodeFirst">
<Source Path="DBMigration" DbContext="isMVC.Models.ApplicationDbContext, isMVC" MigrationConfiguration="isMVC.Migrations.Configuration, isMVC" Origin="Configuration" />
</Object>
</ObjectGroup>
</Objects>
</PublishDatabaseSettings>
But I get "Update-Database" as an option :
Since the Object Type is "DbCodeFirst", so it should be "Execute Code First Migration" option while web deploy.
Any help please!
Thanks in advance.

Banner not shown

I started to use advertising control, but I'm going crazy trying to let it work.
I copied PivotPage.xaml from Microsoft Ad Control Sample and made it the starting page in my app, but ad control is not shown (I'm not able to see banner); if I try to run Microsoft app, banner is shown.
So I registered my app on pubCenter and I got an appId and a unitId and tried to use them in my app, but the result is the same: no banner!!
If I try to use my ids in Microsoft app, test banner is shown.
Why using Microsoft example I'm able to see banner and using same page in my app I can't?
Why using my ids, Microsoft app does not show correct banner?
Here is XAML
<!--Pivot Control-->
<controls:Pivot Grid.Row="0" Title="Ad Control Sample">
<!--Pivot item one-->
<controls:PivotItem Header="piv 1">
</controls:PivotItem>
<!--Pivot item two-->
<controls:PivotItem Header="piv 2">
</controls:PivotItem>
<!--Pivot item three-->
<controls:PivotItem Header="piv 3">
</controls:PivotItem>
</controls:Pivot>
<StackPanel Grid.Row="1" VerticalAlignment="Bottom" >
<TextBlock Text="This is the same ad."
TextWrapping="Wrap"
HorizontalAlignment="Stretch"
TextAlignment="Center" />
<my:AdControl Name="adControl1"
ApplicationId="test_client"
AdUnitId="Image480_80"
HorizontalAlignment="Center"
Width="480" Height="80" />
</StackPanel>
I finally managed to solve my problem and I want to share solution.
I add an event handler for ErrorOccurred on ad control and reading Microsoft.Advertising.AdErrorEventArgs e I realized that my manifest (WMAppManifest.xml) was missing
<Capability Name="ID_CAP_IDENTITY_USER" />
<Capability Name="ID_CAP_MEDIALIB" />
<Capability Name="ID_CAP_WEBBROWSERCOMPONENT" />

Custom onsynctopreference for XUL textbox

I wanted to enable custom shortcuts in my Firefox extension. The idea is that the user just focuses on a textbox, presses key combination, and it's shown in the textbox and saved to a preference. However, I couldn't get it to work. With this XUL
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://mozapps/skin/pref/pref.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://nextplease/locale/nextplease.dtd">
<prefwindow id="nextpleaseprefs" title="&options.title;" buttons="accept, cancel"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="nextplease.general" label="&options.general.title;" image="chrome://nextplease/skin/Sound Mixer.png">
<preferences>
<preference id="nextkey" name="nextplease.nextkey" type="int"/>
</preferences>
<vbox flex="1">
<hbox align="center">
<label value="&options.general.nextKey;" />
<textbox id="nextkey" flex="1" editable="false"
onkeyup="return nextplease.handleKeySelection(this, event);"
preference-editable="true" preference="nextkey"
onsynctopreference="alert('syncing'); return nextplease.syncKeySelector(this);"/>
</hbox>
</vbox>
</prefpane>
<script type="application/x-javascript" src="chrome://nextplease/content/nextpleaseCommon.js" />
<script type="application/x-javascript" src="chrome://nextplease/content/nextpleaseOptions.js" />
</prefwindow>
the event in onkeyup works. But when I click the OK button, I don't see a "syncing" alert. Why isn't onsynctopreference working? Is it impossible to have custom onsynctopreference attribute for a textbox?
It seems the problem was simply that preferences are only synchronized on input event (and maybe some others), but not on keyup.

Resources