Manual filter generation in HP ALM Quality Center - ota

Filters in QC can be copied to clipboard and pasted from it.
[Filter]{
TableName:CYCLE,
ColumnName:CY_FOLDER_ID,
LogicalFilter:\0000004a\^Root\Sprint1^ Or ^Root^ Or ^Root\Sprint2\QA\Func\Columns ordering^,
VisualFilter:\0000004a\^Root\Sprint1^ Or ^Root^ Or ^Root\Sprint2\QA\Func\Columns ordering^,
NO_CASE:
}
{
FLT:[X],
TYPE:TESTSET-TSTEST,
EXISTS_IN_IDS:Y,
IN_IDS:\000000ad\[Filter]{
TableName:TESTCYCL,
ColumnName:TC_STATUS,
LogicalFilter:\0000001a\"Blocking Fail" Or Blocked,
VisualFilter:\0000001a\"Blocking Fail" Or Blocked,
NO_CASE:
}
}
I'm trying to generate such filter in my own application. The problem is that I don't know how 0000004a, 0000001a and 000000ad are generated. When I replace filter values with other values the filter doesn't work anymore. It needs those HEX values to be recalculated.
Does anyone know what is the algorithm of generating that values?

The mentioned items are the lengths of the according filter.text - string in hex

Related

IMPORTXML To Return a Value from dividendhistory.org

I want to return the value of "Yield:" from a series of stocks from a URL dividenhistory.org, for example HDIF into a Google sheet using IMPORTXML, where F7 represents the user supplied ticker.
=IMPORTXML("https://dividendhistory.org/payout/TSX/"&F7, "/html/body/div/div[2]/div[2]/p[4]")
The problem with the above is the yield value is not always located in the same paragraph, depending on the ticker. It also returns with the word "Yield:" as part of the value.
I believe I should be using the XPATH parameter which should find and return the yield value only, but I am lost. I am open to all suggestions!
I tried with a few of the tickers there, and this should work. For example:
=IMPORTXML("https://dividendhistory.org/payout/ctas/", "//p[contains(.,'Yield')]/text()")
Output:
Yield: 1.05%
Obviously, you can change 'ctas' for any user input.
Try this and see if it works on all tickers.
EDIT:
To get only the number 1.05, you need to split the result and output the 2nd part:
=index(split(IMPORTXML("https://dividendhistory.org/payout/ctas/", "//p[contains(.,'Yield')]/text()"), ": "),2)
Output:
0.0105

STM8A CAN Filtering in Standard Peripheral Library

I am working with the STM8AF5286UDY and am trying to set up a CAN interface.
For programming, I use the standard peripheral library. At the moment, my CAN interface works fine. The only thing, which does not work, is filtering.
I use extended IDs and want to get all IDs from 0x18FEC100 to 0x18FEC999.
My code looks as follows:
/* CAN filter init */
CAN_FilterNumber = CAN_FilterNumber_0;
CAN_FilterActivation = ENABLE;
CAN_FilterMode = CAN_FilterMode_IdMask;
CAN_FilterScale = CAN_FilterScale_32Bit;
CAN_FilterID1=0x18FEC101;
CAN_FilterID2=0;
CAN_FilterID3=0;
CAN_FilterID4=0;
CAN_FilterIDMask1=0x1FFFF000;
CAN_FilterIDMask2=0;
CAN_FilterIDMask3=0;
CAN_FilterIDMask4=0;
CAN_FilterInit(CAN_FilterNumber, CAN_FilterActivation, CAN_FilterMode,
CAN_FilterScale,CAN_FilterID1, CAN_FilterID2, CAN_FilterID3,
CAN_FilterID4,CAN_FilterIDMask1, CAN_FilterIDMask2,
CAN_FilterIDMask3, CAN_FilterIDMask4);
I would appreciate any help! Thank you!
EDIT: In my initial code, I forgot to include IDE and RTR at addressing. Also, in the library, each address and mask is an 8-bit value. Therefore, I have changed my code to the following:
/* CAN filter init */
CAN_FilterNumber = CAN_FilterNumber_2;
CAN_FilterActivation = ENABLE;
CAN_FilterMode = CAN_FilterMode_IdMask;
CAN_FilterScale = CAN_FilterScale_32Bit;
CAN_FilterID1=0xc7;
CAN_FilterID2=0xed;
CAN_FilterID3=0x02;
CAN_FilterID4=0x02;
CAN_FilterIDMask1=0xFF;
CAN_FilterIDMask2=0xE7;
CAN_FilterIDMask3=0xE0;
CAN_FilterIDMask4=0x00;
CAN_FilterInit(CAN_FilterNumber, CAN_FilterActivation, CAN_FilterMode,
CAN_FilterScale,CAN_FilterID1, CAN_FilterID2, CAN_FilterID3,
CAN_FilterID4,CAN_FilterIDMask1, CAN_FilterIDMask2,
CAN_FilterIDMask3, CAN_FilterIDMask4);
This filter works for the first 16-bit, so at using 0x18FEC101 it filters the 0x18FE. Somehow, it does not work for the other 16-bit.
In the library, the following code is used for writing the addresses and masks in the filter bank at 32-bit:
else if (CAN_FilterScale == CAN_FilterScale_32Bit)
{
CAN->Page.Filter.FR01 = CAN_FilterID1;
CAN->Page.Filter.FR02 = CAN_FilterID2;
CAN->Page.Filter.FR03 = CAN_FilterID3;
CAN->Page.Filter.FR04 = CAN_FilterID4;
CAN->Page.Filter.FR05 = CAN_FilterIDMask1;
CAN->Page.Filter.FR06 = CAN_FilterIDMask2;
CAN->Page.Filter.FR07 = CAN_FilterIDMask3;
CAN->Page.Filter.FR08 = CAN_FilterIDMask4;
}
Are there any ideas, what my mistake might be?
Thanks!
Mask filtering works bitwise. So you can't create a filter to accept values between 0x18FEC100 - 0x18FEC999. You need to think binary.
In the filter mask registers, 1 means "must match" and 0 means "don't care".
ID = 0x18FEC101 and Mask = 0x1FFFF000 means that it will accept values between 0x18FEC000 - 0x18FECFFF as the filter won't care the least significant 12 bits.
However, the process is further complicated by the bit arrangement of the hardware registers. Be aware that RTR & IDE bits are also included in the filter registers. I don't know if the standard peripheral library handles this but probably not. You probably need to manually arrange the bits to determine the correct register values. In the reference manual (RM0016), refer to Figure 148.
The code I posted (edited version) works now.
Turns out I had a problem calculating the addresses by hand.
Thank you #Tagli.

vars.put function not writing the desired value into the jmeter parameter

Below is the code which i have been trying to address the below UseCase in JMETER.Quick help is appreciated.
Usecase:
A particular text like "History" in a page response needs to be validated and the if the text counts is more than 50 a random selection of the options within the page needs to be made.And if the text counts is less than 50 1st option needs to be selected.
I am new to Jmeter and trying to solve this usingJSR223 POST processor but somehow stuck at vars.put function where i am unable to see the desired number being populated within the V paramter.
Using a boundary extractor where match no 1 should suffice the 1st selection and 0 should suffice the random selection.
def TotalInstanceAvailable = vars.get("sCount_matchNr").toInteger()
log.info("Total Instance Available = ${TotalInstanceAvailable}");
def boundary_analyzer =50;
def DesiredNumber,V
if (TotalInstanceAvailable < boundary_analyzer)
{
log.info("I am inside the loop")
DesiredNumber = 0;
log.info("DesiredNumber= ${DesiredNumber}");
vars.put("V", DesiredNumber)
log.info("v= ${V}");
}
else{
DesiredNumber=1;
log.info("DesiredNumber=${DesiredNumber}");
vars.put("V", "DesiredNumber")
log.info("v= ${V}");
}
def sCount = vars.get("sCount")
log.info("Text matching number is ${sCount_matchNr}")
You cannot store an integer in JMeter Variables using vars.put() function, you either need to cast it to String first, to wit change this line:
vars.put("V", DesiredNumber)
to this one
vars.put("V", DesiredNumber as String)
alternatively you can use vars.putObject() function which can store literally everything however you will be able to use the value only in JSR223 Elements by calling vars.getObject()
Whenever you face a problem with your JMeter script get used to look at jmeter.log file or toggle Log Viewer window - in absolute majority of cases you will find the root cause of your problem in the log file:

SendKeys() is adding default value (issue) + datetime value sent

basically the issue is taking place at the moment when I send some value which is appended to a default value '01/01/2000' somehow. I've tried different ways to do this without succeed, I've used these exact lines in other script and it worked but I don't know why this isn't working here. Please find below the last code I used followed by the picture with the issue displayed.
var targetStartDate = browser.driver.findElement(by.id('StartDate'));
targetStartDate.clear().then(function () {
targetStartDate.sendKeys('09/01/2016');
})
example of the issue
Thanks in advance for any response.
You can try issuing clear() call before sending keys:
targetStartDate.clear();
targetStartDate.sendKeys('09/01/2016');
The other option would be to select all text in the input prior to sending keys:
// protractor.Key.COMMAND on Mac
targetStartDate.sendKeys(protractor.Key.chord(protractor.Key.CONTROL, "a"));
targetStartDate.sendKeys('09/01/2016');
I have encountered this same issue before. There is an input mask formatting the input in the field. In order to solve this, you must write your test as if it were the actual user, with the formatting in mind:
var targetStartDate = browser.driver.findElement(by.id('StartDate'));
// Remove the forward slashes because the input field takes care of that.
var inputDate = '09012016';
targetStartDate.clear();
// Loop through each character of the string and send it to the input
// field followed by a delay of 250 milliseconds to give the field
// enough time to format the input as you keep sending keys.
for (var i = 0; i < inputDate.length; i++) {
targetStartDate.sendKeys(inputDate[i]);
browser.driver.sleep(250);
}
Depending on the latency of the site and performance, you may either need to decrease the 250 millisecond delay, or be able to decrease it.
Hope this helps!

Pulling Images from rss/atom feeds using magpie rss

Im using php and magpie and would like a general way of detecting images in feed item. I know some websites place images within the enclosure tag, others like this images[rss] and some simply add it to description. Is there any one with a general function for detecting if rss item has image and extracting image url after its been parsed by magpie?
i think reqular expressions would be needed to extract from description but im a noob at those. Please help if you can.
I spent ages searching for a way of displaying images in RSS via Magpie myself, and in the end I had to examine the code to figure out how to get it to work.
Like you say, the reason Magpie doesn't pick up images in the element is because they are specified using the 'enclosure' tag, which is an empty tag where the information is in the attributes, e.g.
<enclosure url="http://www.mysite.com/myphoto.jpg" length="14478" type="image/jpeg" />
As a hack to get it to work quickly for me I added the following lines of code into rss_parse.inc:
function feed_start_element($p, $element, &$attrs) {
...
if ( $el == 'channel' )
{
$this->inchannel = true;
}
...
// START EDIT - add this elseif condition to the if ($el=xxx) statement.
// Checks if element is enclosure tag, and if so store the attribute values
elseif ($el == 'enclosure' ) {
if ( isset($attrs['url']) ) {
$this->current_item['enclosure_url'] = $attrs['url'];
$this->current_item['enclosure_type'] = $attrs['type'];
$this->current_item['enclosure_length'] = $attrs['length'];
}
}
// END EDIT
...
}
The url to the image is in $myRSSitem['enclosure_url'] and the size is in $myRSSitem['enclosure_length'].
Note that enclosure tags can refer to many types of media, so first check if the type is actually an image by checking $myRSSitem['enclosure_type'].
Maybe someone else has a better suggestion and I'm sure this could be done more elegantly to pick up attributes from other empty tags, but I needed a v quick fix (deadline pressures) but I hope this might help someone else in difficulty!

Resources