Using DBFit variables for other Fixtures - rest

Is it possible to use a DbFit variable in another fixture? For example, if I create a query in dbfit with a variable <<firstname as follows:
SELECT * FROM System.Columns Where ColumnName= 'FirstName' | <<firstname |
Is it possible to include a reference to that page in another suite of tests that use a column fixture or RestFixture and call the variable name to check against the database?
In the RestFixture, I'm checking a database column name against a node so can I do something like:
| GET | /resources/6 | | //${firstname} |
Where I'm checking if an xml node named FirstName exists in the database.

With fitSharp (.NET), it is. With Java, I'm not sure.

I was struggling with the same issue, imo it's hard to find any good documentation. I stumbled upon the answer skimming some arbitrary tests somewhere.
You can access the symbol in RESTFixture using %variablename%.
RestFixture
| GET | /resources/6 | | //%firstname% |

Related

Aggregating Wildcards in Sumologic

I'm trying to aggregate the API logs based on the different endpoints I have. There are a total of 4 endpoints:
1: /v1/vehicle_locations
2: /v1/vehicle_locations/id
3: /v1/driver_locations
4: /v1/driver_locations/id
The way I'm currently doing this is:
_sourceCategory=production | keyvalue auto | where (path matches "/v1/driver_locations" OR path matches "/v1/driver_locations/*" or path matches "/v1/vehicle_locations" or path matches "/v1/vehicle_locations/*") | count by path
The problem with this is that while I get the correct aggregate for /v1/vehicle_locations and /v1/driver_locations, I get individual results for /v1/driver_locations/id and /v1/vehicle_locations/id since the id is a wildcard. Is there a way I can aggregate these wildcards as well?
There are several ways to achieve what you ask. I think the most straightforward one and suggested is to use | parse operator so that you can treat the top-most element of your path as a field, e.g.
_sourceCategory=production
| keyvalue auto
| parse field=path "*/*" as topmost, rest
| where (topmost = "vehicle_locations" or topmost = "driver_locations")
| count by topmost
Note that by default | parse operator works on the raw message (e.g. the original log line), but you can make it parse a field - using the field= syntax and this is what it's used above.
You might want to tweak the parse expression or use a regex depending on the actual paths you encounter.
(Disclaimer: I am currently employed by Sumo Logic)

Storing text and using only part of it later

Incredibly new to Selenium IDE / Automating tests and currently I am trying to store part of a text, which is a variable to use in later in another web page.
I haven't actually tried much but have been reading quite a few threads but I'm just not grasping the concepts I guess
<tr align=center> <td><font size='+1' color='white'><b>Authorization Request - Confirmation Number: 219927</b> </font></td></tr>
In this example, I need to be able to store 219927 to use later on another site
The below has passed all of the tests but I seem to not be able to echo the output back on another site:
store | xpath=//b[contains(.,'Authorization Request - Confirmation Number: 135085')] | string
store | 1 | delimiter store | javascript{storedVars['string'].split('- ')[storedVars['delimiter']]} | test
store | 0 | delimiter1
store | javascript{storedVars['test'].split(',')[storedVars['delimiter1']]} | output
echo | ${output}

Are there publics Enums for ExtendedPropertyDefinition IDs?

Much like in the example from this question I see many code snippets on the web using magic numbers when making ExtendedPropertyDefinition. Example:
Dim PR_DELETED_ON As New ExtendedPropertyDefinition(26255, MapiPropertyType.SystemTime)
Dim PR_SEARCH_KEY As New ExtendedPropertyDefinition(12299, MapiPropertyType.Binary)
I have sort of found a reference location for these on MSDN. I can look them up individually as supposed to one large table. Here is the one for PR_DELETED_ON like in the above example
+------------------------+---------------+
| Associated properties: | PR_SEARCH_KEY |
+------------------------+---------------+
| Identifier: | 0x300B |
+------------------------+---------------+
| Data type: | PT_BINARY |
+------------------------+---------------+
| Area: | ID properties |
+------------------------+---------------+
0x300b being 12299 in decimal
I hate magic numbers so I was looking for an enum for this in the EWS API. I wrote this snippet to (hopefully) show me all the enums exposed.
$obj = [Reflection.Assembly]::LoadFile("C:\Program Files (x86)\EWSManagedAPI\Microsoft.Exchange.WebServices.dll")
$obj.GetTypes() | Where-object{$_.isenum -and ($_.ispublic -or $_.isnestedpublic)} | ForEach-Object{
$props = #{Name = $_.FullName}
[enum]::GetValues($_) | ForEach-Object{
$props.Integer = [int64]$_
$props.Text = $_
[pscustomobject]$props
}
}
I didn't see anything in the output that matched what I was looking at above. Does anyone know if there is a preexisting enum for these properties? If not that is fine. I just assumed there would be something out there.
Not the end of the world but I couldn't find them myself. Might explain why code snippets keep referencing to them.
No there is nothing in the EWS Managed API for this and AFAIK there is no master list maintained by Microsoft. There are also different types of Properties eg Tagged and Named properties and to use an Extended property in EWS you need to first define and tell Exchange to either return or set that property so EWS doesn't allow you to enumerate all the Extended properties on a Item like MAPI. The closest list that I know of is the one from the EWSEditor which is pretty comprehensive https://ewseditor.codeplex.com/SourceControl/latest#EWSEditor/PropertyInformation/KnownExtendedPropertiesData.cs . The Mapi include files also have a good list eg https://github.com/openchange/openchange/blob/master/properties_enum.h (but these are only tagged properties).

Use powershell to get instance description and tags

Is there a way of getting instance's description (eg, instance ID, AMI ID, VPC ID....etc) and tags using Powershell?
I tried Get-EC2Instance | select * but it doesn't give all the information I need.
Good starting point would be to store your instances in a variable.
$ec2 = Get-EC2Instance
$ec2.instances
will display all the info you can get.
Same can be done like this
(Get-EC2Instance).Instances
or filter only what you need.
(Get-EC2Instance).Instances | select-object ImageId,InstanceId,VpcId

Talend save Oracle Sequence number to context variable

I've the following problem: I want to get the next sequence number from Oracle and save it into my context variable.
I have a working tOracleInput_1 (tLogRow shows correct output:)
.-------------------.
|#1. tLogRow_1--tLogRow_1|
+----------+--------+
| key | value |
+----------+--------+
| datei_id | 264032 |
+----------+--------+
Now I'd like to write this value ('datei_id') to 'context.dateiId'. For this I've made a main-row to tJava and in tJava:
context.dateiId = ((String)globalMap.get("tOracleInput.datei_id"));
The value of context.dateiId is now
null
Can anyone help me with this issue?
use tJavaRow in place of tJava and inside it use context.dateiId = input_row.schemacolumnName;
where schemacolumnName is your column name from tOracleInput schema which is mapped to tJavaRow via main flow