With CodedUI, is there a way to determine that an element with a given ID exists on a webpage? - coded-ui-tests

For example, if my page contains the following code:
<a id="foo" href="#">Click Me!</a>
Is there a way with CodedUI to verify that a link with id equal to "foo" is present on the webpage?

Inspect the link with the Coded IU cross-hairs (ie assertion building) tool. The properties shown should include the Id field. You can then generate an assertion that the link contains the text Click Me!. Make sure the generated search properties include the required value for the link property. If the Id field or the displayed text are variable (perhaps their values are data driven or found earlier in the test) then before finding the control (implicitly or explicitly) set the required values. This should work because the assertion can only be checked if the required field is found on the screen and that find uses teh Id field.
Perhaps your question is a more general "is there such a link anywhere on the web page"? If so then you can use the GetChilden() to do a recursive traverse of the web page. Check each UI Control found to see if it has the desired values.

Related

SharePoint online people search display template showing skills managed property

I'm currently working on creating a custom display template for people search result page. I copied out of the box Item_Person.html search display template and modified it to display some more fields.
In the out of the box template also there is a managed property called skills but when I using it, its not returning any values associated with the user profile skills property (SPS-Skills).
As you can see its already mapped but Skill value always comes as empty. I want to retrieve and display inside the custom template.
Please help me if you have done something similar.
Check the following steps
Add meta data to ManagedPropertyMapping
2.Then inside the fuction get the value of metadata
<!--#_ var datacreated = $getItemValue(ctx, "Created");_#-->
3.Then palce the variable where you want <h2> _#= datacreated =#_ </h2>
Thats it publish the html hope its work

how do i add ext.net dynamical web form control and retrieve its contain value to save in DB.?

i want to dynamically add two text box and obtain values from those and display as message ...
please help me though example to demonstrate this scenario where I can learn and apply for my actual problem
Take alook at those examples
http://examples.ext.net/#/XRender/Basic/Add_Items/
http://examples.ext.net/#/XRender/Basic/New_Window/
*those links ,official web site of ext.net.
instead of adding tab or windows ,just change them to TextField.
u can assign unique id for each element added dynamically,and reach those element via Id

Is there Java/SSJS equivalent of #AttachmentModifiedTimes?

I want to show list of attachments and FileDownload control is not an option (need custom actions for every file).
To get name and size of attachments there are properties of EmbeddedObject. AFAIK, to get modified time of attachment there is only one option: to use pure #Formula, either via session.evaluate or view containing column with #AttachmentModifiedTimes.
Is there a way (Java/SSJS) to get attachment's modified (and created) time without native #Formulas? That means date stored with file shown in document properties for $FILE item.
You can add a Repeat Control to the page and bind that to the attachments (stored in a rich text field) using document1.getAttachmentList("rt_field_name"). Every item in that list is an object of class
com.ibm.xsp.model.domino.wrapped.DominoDocument$AttachmentValueHolder
That class has a getLastModified() method that returns the last modified time as a Double.
A couldn't find a reference on the web showing the full API, but if you use the API Inspector in the XPage Debug Toolbar (sorry for the shameless plug...) you can view all properties and methods using:
getComponent( 'id_of_repeat_control' ).getDataModel().getRowData()
UPDATE
Found the API here,
I am not 100% sure what you want to achieve.
In general you can use #AttachmentModifiedTimes() - as well as #AttachmentNames() - as SSJS.

Sharepoint 2007 Data view Webpart custom parameters

I'm sort of new to the custom parameters that can be setup on a DataView Webpart.
There are 6 options:
- None
- Control
- Cookie
- Form
- QueryString
- Server Variable
I think that None, Cookie and QueryString speak for themselves and are pretty straightforward.
The issue comes from the other 3. There isn't much documentation as to what they are and how they can be used (or I haven't found it)
I know that there's plenty of tutorials that explain that a dropdown can be a matched to a dataSource and then used as a parameter source 'control'.
If you don't use a datasource it seems that parameter source 'control' isn't the right item to pick as the parameter specified will never be populated with the dropdown values.
If anyone could explain the different parameter sources? Also how would one use checkboxes or a simple input text box to filter a dataview webpart?
Thanks for any tips/help.
ps: here's the link to the dropdown parameter use:
http://sharepointxperiments.wordpress.com/2009/08/03/multiple-filters-on-a-data-view-webpart/
The other 3 are:
Control: Binds the DataForm(or View)WebPArt to a control somewhere on the page using the following syntax:
<ParameterBinding Name="Meal" Location="Control(clStartDate)" DefaultValue="01-01-2010"/>
or
<ParameterBinding Name="StartDate" Location="Control(clStartDate, SelectedValue)" DefaultValue="01-01-2010"/>
Where clStartDate is an ASP.NET Calender Control.
You see that Control() takes either 1 or 2 parameters, the second is the name of the property on the control you want to use (i.e. 'Text' or 'SelectedIndex' etc etc.).
If you leave it empty (like in option 1) it will use the Control's DefaultProperty (as defined by the control itself).
As for the Form option, I've never used it before but I'm guessing it can be used to bind to a value received through a Form POST action.
More info can be found here

Sharepoint: Image field with a link

I would like to add a field to a list with displays an Image, but acts as a hyperlink. In other words like the "Hyperlink or Picture" column, but "Hyperlink AND Picture" instead.
Where the two fields you input would be the URL to the image to display, and the URL of the hyperlink.
This must be possible. I notice that the Type (in a document library) column does just that, and also includes the views that are currently being used (in the case of a folder).
Is it possible to duplicate the computed Type field in a document library to read two other fields in the list (which will act as the image url, and the redirect link)? What would the CAML be?
Thanks in advance if anyone could offer any insight.
Arnhem
This can be done but you would need to develop a custom field type. As you have found, SharePoint's default rendering for pictures is without the hyperlink. You need to change how the rendering behaves in Display mode in your own custom field. Check Patterns in Custom Field Rendering for more info.
There are also several examples of creating custom field types on the web. The MSDN articles give a lot of detail about how it all works but don't let that put you off as it's not too tricky.

Resources