I recorded a click on a link inside of a tablecell in a grid, then modified the code after moving it to the UIMap file. There are many links in the grid, but they can only be used once then they go away. The links are a person's last name as the InnerText property. I am passing a persons last name in via the sLastName variable. I am finding that this works in places but not all the time and would appreciate any feedback.
Public Sub ReviewPhysOrdClick(ByVal sLastName)
Dim uILastNameHyperlink As HtmlHyperlink = Me.UIPaperlessAdministratWindow1.UIPaperlessAdministratDocument9.UINamelast1449Hyperlink
'all stuff to help it find a link in the grid to click
uILastNameHyperlink.SearchConfigurations.Add("Id") 'add id property as a search item
uILastNameHyperlink.SearchProperties.Add("Id", "ctl20__UserGrid", PropertyExpressionOperator.Contains) 'search parameter
uILastNameHyperlink.SearchProperties.Add("InnerText", sLastName, PropertyExpressionOperator.Contains) 'search parameter
uILastNameHyperlink.Find() 'prompts a search for the control before any action is taken
Mouse.Click(uILastNameHyperlink) 'click the link
End Sub
This code can be used where ever the id of the menu item which you want to click keeps on changing on change of environments or menu lists.You can directly edit the designer map of the
codedui test and comment the other search properties which where captured while recording the test.Put this three lines of code instead of captured lines.It works well.
Related
As title says I am attempting to identify a new element that is added to a page after an add new button is clicked that shares an xpath the same as many other elements.
To give some background there is a list of items on the page. You can interact with the list in the following ways. Add New, Edit and Delete.
You can add a new row to the list. When you click add new you type in text to name the item in the list and then have the option to save or cancel.
The cancel element (new row) is the same as the delete element (existing row) in terms of xpath (except where it is on the list).
I can't use the specific list element because this is an automation script that would run everyday and the position on the list could change.
Any thought on what I could do to do identify the xpath of the new cancel button when add new is clicked.
The button itself does not contain words but is an image of a trashcan, so I can't use something like text to find a cancel button.
I saw some ways to add text to find by but the issue I'd run into is that a user could generate this new row at anytime.
Any thoughts would be helpful! :)
Thanks!
To identify the new cancel button, you can try and tweak (it's a wild guess) one the following XPath expressions :
If the trash is an image, we look for an element which child contains a #src attribute (the name of the image : trash.gif for example).
//*[./*[contains(#src,"trash.gif")]]
If the trash is an icon, we can search the same way as before (you need to identify the name of the icon) :
//*[./i[contains(#class,"trash")]]
Somebody pulled the most random question on me today and I realized I'd never even considered it. What they wanted was my PDF rendering of an SSRS report to come standard with navigation arrows, i.e., previous page, next page. This started me looking at all the options that are available, which are actually kind of cool, and I was able to add on a table of contents, including bookmarks for a new number (e.g., if you're printing 5 invoices with 2-5 pages each into one long document, those will have the invoice number and you can jump to the beginning of that invoice), but I couldn't see anything about navigation links. In fact, most of what I've seen says that PDF's only can have navigation maps, i.e., the table of contents tab. So if anyone has any ideas on how I can do this, that would be great. I know it can be added after-the-fact with something like Blubeam, but that's not practical in this case.
As I mentioned in comments you can create a bookmark in each page. A bookmark can be added using the component DocumentMapLabel property almost all SSRS Report Items (Tablix, Textbox, Charts, etc) have.
If you don't have a title or a textbox at the very top of each page, add an empty textbox, be sure place them at the top of the page in order to each bookmark jumps to the beginning of the corresponding page.
Select the first textbox and press F4 to see the extended properties window, look for DocumentMapLabel and type Page 1.
In each page set the textbox DocumentMapLabel property to the corresponding page number.
When the report is exported to PDF, your PDF client shows the bookmark menu, containing a bookmark for each page. If you click on a bookmark it jumps to the related page.
This is how it looks in Adobe Acrobar Reader:
Let me know if this helps.
I've been searching for a few days and doing every word combination I can think of to try to find the answer to my issue. I'm hoping someone can help me.
Before I begin I'd also like to say I'm very new to Access and admittedly not great with it. I'm still learning so this could be a very easy fix or I may have messed up beyond belief.
The issue I'm having is I've setup several page tab on a form and entered all the information for my records. However I cannot get the page tabs to pull up the corresponding records. Instead I have to either search through the records which doesn't always work or I have to arrow to the right record after selecting the tab I want. I'd like it so that when I click the tab it brings up the proper record automatically. If someone can point out where I'm going wrong and how to fix it I would greatly appreciate it. See below for some pics of what I mean.
As you can see in the first image. The tab name "Auto PLUS" doesn't bring up the proper record. instead I have to manually change the record using the arrows at the bottom of the form (see the arrow at the bottom of the image) in order to change the record. I need the record and the tab to match. Any help would be so greatly appreciated.
Thanks in advance for any help!!
-Deke
Assuming your form is bound (if in design mode your fields do NOT say "Unbound" then your form is bound), you simply need to add some VBA code to each tab's OnClick event.
Enter design mode and select the first tab "Claims Other". Open the properties pane, click the event tab, and click the ellipsis at the end of the OnClick line. When prompted, select "Code Builder" and it should launch the Visual Basic Editor.
It will put your cursor automatically in the correct position. Copy/Paste:
DoCmd.GoToRecord acDataForm, Form1, acGoTo, 1
The 1 should correspond to "Claims Other's" proper record in your table. Use the row number, not the ID number to determine what it should be.
Go back to Form View and click on the "Claims Other's" tab. The data should show the corresponding record in your table.
Repeat the steps of adding events to each tab, finding the relevant record in your table, and replacing the 1 from the above code.
I want to add an option to the row of the view: the possibility to open the document when clicking on the row. It is possible? How can I achieve this?
Add displayAs="link" to viewColumn. Then it is rendered as link and opens the document if you click on it. You can also choose to open it in edit or read mode.
Set the attributes in properties panel:
Update:
You can open the corresponding document clicking somewhere on a viewPanel's row (not just on a column's link) if you add a rowAttrs property.
Add the following code to your viewPanel:
<xp:viewPanel
rows="30"
id="viewPanel1"
var="row">
...
<xp:this.rowAttrs>
<xp:attr
value="window.open('#{javascript:row.getOpenPageURL(null, true)}', '_self')"
name="onclick"
rendered="#{javascript:!(row.isCategory() | row.isTotal()) }">
</xp:attr>
</xp:this.rowAttrs>
</xp:viewPanel>
Set viewPanel's row variable to var="row". The attribute attr gets rendered for all rows which are represent a document. It adds an individual onclick event to those rows and executes CSJS code defined in value. This CSJS code contains a SSJS part which inserts the URL of the document as window.open's parameter.
If you set getOpenPageURL's second parameter to false then document will be opened in edit mode.
Look here for a detailed description.
I think there is no easy way ;-) Maybe JQuery is your friend to add a on click event to the row with needed
As declared in the title, for example, I want to search for a button whose name is button8, within a form where there are so many buttons that I do not want to check the name one by one.
Can I do this in VB6?
You should just be able to refer to the control via the controls collection, like so:
Me.Controls("Button8")
See this link.
Here's how to find a control in the form designer, if you know the name.
Go to the form designer, open the property window (press F4), and use the dropdown to choose the control. This shows the properties in the window (and you can edit them). It also selects the control onscreen.