iOS UI Automation - how to find a row within a tableView - ios-ui-automation

I want to use UI Automation to look through a tableView and find the row that matches a certain label, and select that row. Is there a way to do this with UIAutomation?

UIAutomation framework uses the UI element hierarchy to locate specific element on which you want to perform an automated action. Once you locate the table view from the UI element hierarchy of your app, you can call the function .cells().firstWithName(The value of the name property of that cell).tap(). This function will search all the rows of the table and tap on the first row with the name that matches the name string that you have passed as the argument. There is also a function .withName(The value of the name property of that cell) that returns an array of row objects all of which contain the name that matches the name string that you have passed as the argument.
p.s. The above mentioned functions only work with the name property.
Hope this helps!

Related

PowerApps formula for matching records from a drop down

I'm trying to build a login form that performs a simple check against the user's PIN. The pin in stored in the database as a field in the Person entity (table).
I have a Team entity that allows the Person to select the Team they are on from a dropdown list of all Teams. The Person entity dropdown then populates based on the Person's TeamID. The User selects their Name and enters a PIN number in the txtPinNumber textbox.
The Login button is hidden by default and should only have visible = true when the pin entered into txtPinNumber is the same as the PIN field in the database.
I have the visible property of the btnLogin button set to
If(txtPinNumber.Text=Filter(Personnel,ddResponder.Selected.PIN),true,false)
However, I'm getting an error of unspecified type. Is it because I'm trying to check the entered PIN against a filtered datatype?
Any ideas on how to fix this error?
It looks like you're having difficulty because of your usage of the Filter() function. Filter() returns a table with all of the rows that meet a given criteria. However, it seems that ddResponder.Selected.Pin is the PIN you are seeking to match. If this is the case, you can simply have the visible property set to:
txtPinNumber.Text = ddResponder.Selected.Pin
If, however you need to do a search in your table to find the relevant PIN, you will instead want to use the Lookup() function.
You can see the documentation for these functions here:
https://powerapps.microsoft.com/en-us/tutorials/function-filter-lookup/
The Lookup() function will return the first matching row based on the criteria you provide, otherwise it will return a blank. You can use this with the IsBlank() function to determine whether or not to display the button.

VB Getting the selected item from a List View

I have a list view with two columns and I'd like to be able to save the value of the leftmost column for the selected row, or even better make it so that once the user clicks on either the right or left column of any given row, the entire row selects and not only the field that was clicked.
However I'm struggling to get the field saved which is more crucial than the row highlighting.
In a list box it would be
string = listbox1.selecteditem.tostring
However this doesn't seem to work for the list view. It won't even let me put "Selecteditem" and instead requires I put selecteditems, however this doesn't seem to do what I want either.
When I use the code:
string = ListView1.SelectedItems.ToString
I get the result of
string = "System.Windows.Forms.ListView+SelectedListViewItemCollection"
Despite the selected field actually being "EGG".
I need to have two columns so can't switch to using a listbox, although that seems like it would be the easier solution.
When I tried googling this question I could only find things for C#
Set FullRowSelect on to get the entire row to select.
SelectedItems.ToString refers to the collection of selected items.
SelectedItems(0).Text refers to the first selected item's text property.

How to get dynamic created table's total column and row using Request.Form in vb.net

I am doing my project in Vb.net using MVC 4.0
I have created dynamic table and in that textboxes in td using javascript and now i want to get that table's total row and column as well for further process in Controller function.
How I can get using above using VB.net?
I have used Request.Form but the id of the textboxes in table is created uniquely so first I want to find the total column and row so based on that I can move further and check using for loop.
It seems like if you are generating your table through javascript you should also be able to set the value of a hidden field to the value you are outputting to your totals column. If you created a hidden field with the value set you should be able to access it from the Request collection. If it is not actually in a field that gets posted back you will only be able to access the value from the client-side.
document.getElementById("myInput").value = "Value you are outputting to your "total" cell
[Solved]
I got all the controls on code behind by it's name by using FormCollection just i need to do is post back the form using form action method because with using ajax i am not getting the formcollection in code behind but directly using form action method i can get all the controls name.
These are the textbox ids by which i can get the value just need to do further process like:
For Each _formvalues As String In formcol
formcol(_formvalues)
Next
fomcol is an object of FormCollection,_formvalues is used for moving one by one name coming in formcol and to take the data inside means name just write formcol(_formvalues) that's it.

QTP - Clicking on a button with a given value

I've started using QTP last weekend so I'm still a bit confused about some things.
I've coded a function that opens an URL on IE, performs some actions and writes a report. But I have a little problem: at a certain point the function has to click on a button to go on but this button's value is changed at every refresh of the page.
For example: at the first access the button's value (or label) is "Results List (51)" but, if I refresh the page, the value becomes "Results List (11)".
What changes is the number inside the brackets (that identifies the number of results inside the list).
Obviously I recorded the action only one time and the result is this:
Browser("myBrowser").Page("myPage").Frame("myFrame").WebButton("Results List 51)").Click
How can I click on the button without having to worry about it's value?
You should open the object repository and have a look at the description that was create for your WebButton then make the property in question a regular expression.
In your case the value should be Results List \(\d+\), this means Result List followed by open-parentheses, followd by one or more digits (a number) followed by close-parentheses.
Here's an explanation on how to use regular expressions in UFT.
This question reminded me of the days when I was a beginner in QTP ;) I think I still am!
Coming to your question -
If you don't really care about what is inside the brackets then you can just give Results List*.* but if you want to check if there is a bracket and digits within it then use the value suggested by Motti i.e. Results List (\d+)
Detailed Steps as you are a rookie:
1) Go to Resources->Object Repository
OR
In the Resources pane expand your action and double-Click the local object repository (You recorded hence the objects will be in local)
2) Click on the Concerned Object so that the object properties specific to this object is displayed.
3) Select the property (name?), at the extreme right you will see a button to configure the value, click on it.
4) Type the text Results List (\d+) or Results List*.*, select the checkbox for regular expressions.
5) A message box will appear, Click on No and then OK button.
Your script should run now!

Tracking item within a collection on WP7

I'm building a WP7 (VB.NET) app and have a custom class, PinInfo, of which I have two ObservableCollections, TempPins and FavoritePins.
In various parts of the app, I need a unique identifier to get a reference to a particular PinInfo in the collection, so at present, I assign an ID to the PinInfo when it's added to the collection, then later get a reference to the pin via the ID.
For example, if I create a button to delete a pin, I set its tag to the pin's ID, then the button click handler reads the button's tag to get the corresponding pin from the collection (via LINQ).
I generate the ID by adding one to the last-assigned ID, but these lists are often modified (i.e. items removed), so I end up with needlessly large ID numbers (e.g. just a few items, with IDs in the thousands).
How can I structure this better?
You could use a Guid instead of an integer ID.