I have a Field naming SUBJECT with translate value:
Translate Value: Math
Long Name: Mathematics
Short Name: Mathematics
Now I have a Record naming PS_CLASS which has SUBJECT as field, now basically the values of SUBJECT in PS_CLASS would be 'Math'.
The problem is I want it to store the Long Name of that translate value, so instead of SUBJECT having 'Math' as value, it will have the value of 'Mathematics'.
Any idea how to do this?
Thanks!
Related
I'm querying a database and one of the fields contains a string in the following format:
ids {
Id: 12
Id: 12345
Id: 67891
}
Sorry if this is a stupid question, but this obviously isn't JSON since it doesn't have quotes, no commas to separate the values, and the keys are all the same.
Does anyone have any idea what the above format is called?
Thanks!
Suppose we have a type Book declared as
type: object
properties:
bookId:
type: StringId
description: Book identifier
And a type StringId
type: string
description: UTF-8 string, max length 256 characters
Is there any way to merge descriptions from bookId in Book and StringId to get the final description of bookId rendered like this
Book identifier
UTF-8 string, max length 256 characters
I'm using raml2html tool for rendering
Thanks in advance!
Looks like it's not possible so far
Let's see if raml2html can be extended for that https://github.com/raml2html/raml2html/issues/425
I know that with Descriptive programming you can do something like this:
Browser("StackOverflow").Page("StackOverflow").Link("text:=Go To Next Page ", "html tag:=A").Click
But is it possible to create some kind of string so I can assign more than one data value and pass it as single variable? I've tried many combinations using escape characters and I always get error.
For example in the case above, let's say I have more properties in the Page object, so I'd normally have to do something like this:
Browser("StackOverflow").Page("name:=StackOverflow", "html id:=PageID")...etc...
But I'd like to pass "name:=StackOverflow", "html id:=PageID" as a single variable, so when writing many objects I'd only have to write:
Browser(BrowserString).Page(PageString).WebEdit("name:=asdfgh")
And the first part would remain static, so if the parents' data needs to be modified I'd only have to modify two variables and not all the objects created in all libraries.
Is it possible?
If I was not clear enough please let me know.
Thank you in advance!
I think what you're looking for is UFT's Description object
This allows you finer grained control on the description since in descriptive programming all values are regular expressions but with Description you can turn the regular expression functionality off for a specific property.
Set desc = Description.Create()
desc("html tag").Value = "A"
desc("innertext").Value = "More information..."
desc("innertext").RegularExpression = False
Browser("Example Domain").Navigate "www.example.com"
Browser("Example Domain").Page("Example Domain").WebElement(desc).Click
If you want to represent this with plain string then it's a bit more of a problem, you can write a helper function but I'm not sure I would recommend it.
Function Desc(descString)
Set ret = Description.Create()
values = Split(descString, "::")
For Each value In values
keyVal = Split(value, ":=")
ret(keyVal(0)).Value = keyVal(1)
Next
Set Desc = ret
End Function
' Usage
Browser("StackOverflow").Page("StackOverflow").WebElement(Desc("html tag:=H2::innertext:=some text")).Click
Further reading about descriptive programming.
As an alternative to Motti's excellent answer, you could also Set a variable to match your initial descriptive object and then extend it as required:
Set myPage = Browser("StackOverflow").Page("name:=StackOverflow", "html id:=PageID")
after which you can then use
myPage.WebEdit("name:=asdfgh")
throughout the rest of the code, so long as the myPage object stays in scope...
Is it possible to add a description or a comment to the arguments that are accepted in a query with graphql?
I have a Query as follows:
field :users, types[Types::UserType] do
description 'List of Users. Date parameters accepted in yyyy/mm/dd format.'
# Required for date range search, accepts string (yyyy/mm/dd)
argument :from_date, types.String, default_value: nil
as you can see, currently I'm adding the description of the parameters to the description of the field. In the graphiql schema where it describes the types I see:
users(from_date: Stringto_date: Stringemail: Stringname: Stringoffset: Intlimit: Int): [UserType]
when I click on the from_date it describes a string. Is there anyway to have it describe the format of the string? eg. "A string in yyyy/mm/dd format."
Thanks!
Looking at the docs, you should be able to do something like:
argument :favoriteFood, types.String, "A string in yyyy/mm/dd format", default_value: nil
Consider this excerpt from https://github.com/apiaryio/mson#example-1 ...
Example 1
A simple object structure and its associated JSON expression.
MSON
- id: 1
- name: A green door
- price: 12.50
- tags: home, green
Let's say I would like to define valid values for the name attribute. Consider a context of API testing with a tool such as Dredd. We may need to define what are the expected/valid name values in response to GET'ing this resource, or else something is probably broken and this test step should fail.
And/or, if creating/updating a resource of this type, we may need to define what name values are valid/accepted. Is this currently possible to define in MSON?
(I believe this can be done in a JSON schema, which makes me hopeful for MSON support.)
Following is an example API Blueprint resource to illustrate how this would be used...
# Thing ID [/api/thing/id]
# List Thing ID attributes [GET]
+ Response 200
+ Attributes
+ href (string)
+ make (string)
+ model (string)
+ version (string)
+ Body
{"href":"/api/thing/id","make":"BrandX","model":"SuperThingy","version":"10.1"}
In the above example, there are 3 known/accepted/valid values for the model attribute: CoolThingy, AwesomeThingy, and MLGThingy
Can we represent this resource in MSON, such that...
Apiary (or other rendered) API documentation consumers can easily know what model values to expect?
Dredd processes and passes/fails the model value in the response to a GET to this resource?
In MSON you can use enum, see the example below.
name (enum[string])
joe (default)
ben
mark