Decriptive Programming Multiple properties - html

I am using to UFT and having a problem in describing multiple properties for an object.
b_username = "html id:=txtUsername","type:=text"
Trying this has not helped me. Even tried the ";" delimiter but that too is not working.

I think you have misunderstood how to reference an object using Descriptive Programming.
You still use the UFT syntax of Browser().Page().WebEdit() (for example) and because you are trying to set an object reference you need the Set keyword. Try something like:
Set b_username = Browser("micclass:=Browser").Page("micclass:=Page").WebEdit("html id:=txtUsername","type:=text")
This will allow you to use b_username to reference the text box with the html id of txtUsername:
b_username.Set myUsernameValue
For a pretty good basic introduction to descriptive programming, check out LearnQTP.com

What you are more closing attempting to do is to build a Description Object.
You need something like the following:
'Creating a description object
Set btncalc = Description.Create()
'Add descriptions and properties
btncalc("type").value = "Button"
btncalc("name").value = "calculate"
btncalc("html tag").value = "INPUT"
' Use the same to script it
Browser("Math Calc").Page("Num Calculator").WebButton(btncalc).Click
This SO article has a good explanation of a little more advanced technique.
How to create description object model at runtime in uft/qtp?
Please let me know if this clears up some confusion.

I would suggest you to use the below library for descriptive programming. It saves you from creating tons of descriptive objects. Check the usage in the link below.
http://www.testautomationguru.com/qtpuft-advanced-descriptive-programming/
To enter some value in the all the textboxes (no need to iterate)
Browser("creationTime:=0").Page("micclass:=Page").getChildObjects("micclass:=WebEdit").SetValue "1"
To enter some value in a textbox whose name starts with ‘guru’
Browser("creationTime:=0").Page("micclass:=Page").getChildObjects("micclass:=WebEdit,name:=guru.*").SetValue "1"
The above example can also be written as
Browser("creationTime:=0").Page("micclass:=Page").getChildObjects("micclass:=WebEdit").WithRegExProperty("name:=guru.*").SetValue "1"
To get the fifth visible child object which has the name as guru.
Browser("creationTime:=0").Page("micclass:=Page").getChildObjects("micclass:=WebEdit").WithRegExProperty("name:=guru.*").Index(4).Set "1"
To enter the values only in the visible text boxes
Browser("creationTime:=0").Page("micclass:=Page").getChildObjects("micclass:=WebEdit").WithRegExProperty("name:=guru.*").VisibleChildObjects.SetValue "1"
To select all visible check boxes
Browser("creationTime:=0").Page("micclass:=Page").getChildObjects("micclass:=WebCheckBox").VisibleChildObjects.SetValue "ON"
To get items count
Browser("creationTime:=0").Page("micclass:=Page").getChildObjects("micclass:=WebCheckBox,type:=checkbox,name:=jqg_list.*").VisibleChildObjects.getCount()
To match certain property values
Browser("creationTime:=0").Page("micclass:=Page").getChildObjects("micclass:=WebEdit").WithRegExProperty("name:=guru.*").VisibleChildobjects().Set "1"
To give some delay between 2 ‘Set’ – [if required for something]
Browser(“creationTime:=0”).Page(“micclass:=Page”).getChildObjects(“micclass:=WebEdit”).WithRegExProperty(“name:=guru.*”).VisibleChildobjects().DelayEachSetBy(1).Set “1”

Related

concatenate variables in angular property element

I comment, and looked here and I can not find the solution, my problem is the following:
in my html template in angular, I need to pass a series of data to the metadata property of a button, I can't get the correct way to successfully concatenate the variable that contains the value.
this should be the html element:
<mati-button clientId="clientId" flowId="flowId" color="green"metadata='{"user_id":"1234778","email":"som#som.com"}'/>
I tried several ways but I can't insert the respective values....
example:
<mati-button metadata='{"userID": "{{user.id}}" }'></mati-button>
unsuccessfully...
Assuming mati-button is an Angular component with metadata as Input(), you are probably looking for
<mati-button
[clientId]="clientId"
[flowId]="flowId"
[color]="green"
[metadata]="{ userId: '1234778', email: 'som#som.com'}"
></mati-button>
See the guide on property binding to learn more:
To bind to an element's property, enclose it in square brackets, [], which identifies the property as a target property. [...] The brackets, [], cause Angular to evaluate the right-hand side of the assignment as a dynamic expression. Without the brackets, Angular treats the right-hand side as a string literal and sets the property to that static value.
By "dynamic expression" they mean JS-expressions, i.e., a public variable available through the component's TypeScript, a boolean expression, an array, or, like in your case, a JS-object that you can construct inline.
You can try doing this
<mati-button metadata="{'userID': user.id }"></mati-button>
metadata='{" userID ": {{user.id}}}'
in the end I got it. Apparently I don't know why, but the third-party script hides that parameter and it couldn't be debugged in the console, but it does receive them without any problem! Thanks everyone for your help!

SSRS Font Color Using Wildcard parameter

Hi I have a report that i used a wild card search parameter so that i can pull record that contains a certain text.
For example: I need to search for subscription for Mary Johnson so on the keyword search box i just type "John". This set-up is working fine, but now I need to color that search keyword when found for each row. so i need assistance on expression code that mimics SQL syntax of LIKE in SSRS expression. I started to change the font color with =iif(Instr(Fields!ReportRecipients.Value)=Parameters!Keyword.Value,"Maroon","Black"), but it didnt work.
Please advise.
Sample
TOJo.eger#m.com; ruth.tuker#m.com;sandrae.espe#m.com; dan.gay#m.comIncludeReportTrueRenderFormatPDFSubjectDaily Report for IBC Medicare? was executed at #ExecutionTimeIncludeLinkFalsePriorityHIGH"
You can use some .net string functions directly in SSRS expressions. In your case you can use the Contains() function like this.
=IIF(
Fields!ReportRecipients.Value.Contains(Parameters!Keyword.Value),
"Maroon",
"Black"
)
If you are dealing with HTML and only want the search term to be highlighted then you can simply use this as the Value expression. You must leave the text box color properties as default.
=REPLACE(
Fields!ReportRecipients.Value,
Parameters!Keyword.Value,
"<span style=""color:red;"">" & Parameters!Keyword.Value & "</span>"
)
Finally, right-click the placeholder, choose properties and select Mark-up type as HTML
In this example, I used a country list and searched for the word "land", here's the results. The first column just uses the first method I described. The second column adds HTML tags.

SSRS - Multiple font or color within a chart item

I'm using Report Builder 3.0. Long story short, I want to make the font bold for the text in the red box that you see in the image below:
Basically, it's just one expression in the legend field of my value, however, for clarity's sake (for my end users) I wish to make the "title part" bold. I found the following solution for textboxes in a tablix using Html by checking off the "HTML – Interpret HTML tags as styles." checkbox within the Textbox's properties. (http://www.sqlchick.com/entries/2010/10/31/using-different-formats-within-a-single-textbox-in-ssrs.html)
However, I can't find anything similar for graphs! I mean if MS thought about it for tables, I presume they must've given it some thought for a chart setting too.
Thanks to all!
p.s. As an aesthetic solution to my problem, I did think of simply creating a new title field, moving it to the exact same location and formating it. But I'm surious whether there'd be some more "proper" way of doing this.
I'm using the same approach for one of my charts.
STEPS.
Select the Chart series to open property pane. In my case, the chart series name is TWR Chart Series
Select the color property and select to build the expression.
I'm posting one of my expression. You can build your own expression base don your field names etc.
=IIF(Fields!ProductID.Value = 1 OR Fields!ProductID.Value = 6,"#00425E",
IIF(Fields!ProductID.Value = 3 ,"#6B8797",
IIF(Fields!ProductID.Value = 5 OR Fields!ProductID.Value = 7,"#799179",
IIF(Fields!ProductID.Value = 4 AND Fields!sort.Value=99,"#6bb1be","#48597B"))))
If used sensibly, you should get your desired results.Good luck.

Displaying and intrepreting tab layouts

I would like to know if it is possible to 'see' and display the following tab layout maybe through the Attribute Editor etc?
Or how can I interpret it?
In the following, I selected the shader - ShaderParam_resGen_srf01 but after searching through every attributes I can find in the Attribute Editor, I can neither find the CachedLayouts or the ShaderParamTabDepth elements.
Any ideas?
tabLayout -e -selectTabIndex 1"MayaWindow|MainAttributeEditorLayout|formLayout2|AEmenuBarLayout|AErootLayout|AEStackLayout|AErootLayoutPane|AEbaseFormLayout|AEcontrolFormLayout|AttrEdrexShaderSrfFormLayout|scrollLayout121|columnLayout971|frameLayout522|columnLayout976|columnLayout977|MW_ShaderParam_CachedLayouts|MW_ShaderParam_resGen_srf01|ShaderParamTabDepth0";
tabLayout is a UI element, not part of your scene.
From the documentation, this command is selecting the first tab of the specified tab layout control.
The long string is the "path" to the control:
MayaWindow
MainAttributeEditorLayout
formLayout2
AEmenuBarLayout
AErootLayout
AEStackLayout
AErootLayoutPane
AEbaseFormLayout
AEcontrolFormLayout
AttrEdrexShaderSrfFormLayout
scrollLayout121
columnLayout971
frameLayout522
columnLayout976
columnLayout977
MW_ShaderParam_CachedLayouts
MW_ShaderParam_resGen_srf01
ShaderParamTabDepth0
Depending on what you intend by "interpreting tab layouts," other commands listed in the documentation linked above should help you collect the specific information you need. If there's a particular aspect of the layout you want to query, be sure to specify that in your question.

VBA Multiple Objects with 'With' Statement

I have a check box that when checked multiple boxes are disabled on my form.
Currently im using
With Me!Textbox
.Locked = True
Is there a method where I can list multiple objects within the With statement rather than writing out each time for every textbox
e.g.
With Me!Text1, Text2, Text3
It may be easiest to add something to the tag property to identify the relevant controls, "lock", say. Then you can iterate over the controls collection and lock anything with a tag set to "lock".