Selenium IDE - verifyText [error] Actual value '' did not match <acct name> - selenium-ide

1st time post. I'm running a Selenium IDE script in which populated account information is supposed to be verified. I'm using verifyText to do this however I'm getting the error that the actual did not match the value I have set. In this case, I'm hardcoding the value because I know what to expect and I'm copying the value straight from the site. I've attempted to copy the values into a text editor to see if there are any hidden characters but haven't found any. There are 5 fields on the page this happening with.
Here is the IDE script for the rows and the logs. I've exchanged the actual client info with variables
<tr>
<td>verifyText</td>
<td>id=NAME_ON_ACCOUNT</td>
<td><AcctName></td>
</tr>
<tr>
<td>verifyText</td>
<td>id=ADDRESS_1</td>
<td><AcctAddress></td>
</tr>
<tr>
<td>verifyText</td>
<td>id=CITY_PROVINCE</td>
<td><AcctCity></td>
</tr>
<tr>
<td>verifyText</td>
<td>id=ZIP</td>
<td><AcctZip></td>
</tr>
<tr>
<td>verifyText</td>
<td>id=PHONE</td>
<td><AcctPhone></td>
</tr>
and here are the logs
[info] Executing: |verifyText | id=NAME_ON_ACCOUNT | <AcctName> |
[error] Actual value '' did not match '<AcctName>'
[info] Executing: |verifyText | id=ADDRESS_1 | <AcctAddress> |
[error] Actual value '' did not match '<AcctAddress>'
[info] Executing: |verifyText | id=CITY_PROVINCE | <AcctCity> |
[error] Actual value '' did not match '<AcctCity>'
[info] Executing: |verifyText | id=ZIP | <AcctZip> |
[error] Actual value '' did not match '<AcctZip>'
[info] Executing: |verifyText | id=PHONE | <AcctPhone> |
[error] Actual value '' did not match '<AcctPhone>'

You cannot get the text from an input field, but you can store its "value" attribute, then check that this value equals a certain text. For example:
storeAttribute | id=NAME_ON_ACCOUNT#value | nameValue
verifyEquals | ${nameValue} | <AcctName>

Related

Postgres : create JSON object from JSON array and add keys

I need to create json object with keys from json array, keys are first element inside json of array. Please check below for clarity.
customer :<br/>
**id** | **email** | **app_id** <br/>
1 | rick#mail.com | abc <br/>
milestone : <br/>
**id** | **milestone_name** | **app_id** | **raised_at** <br/>
1 | PROFILE_COMPLETED | abc | 2019-05-06 <br/>
2 | ADDRESS_COMPLETED | abc | 2019-05-06 <br/>
select email,
(
select
array_to_json(
array_agg(d)
)
from
(
select
milestone_name,
raised_at,
from
milestone m
where
m.app_id = c.app_id
) d
) as milestones
from customer c;
Above query is giving output :
email | rick#mail.com <br/>
milestones | [{"milestone_name":"PROFILE_COMPLETED","raised_at":"2019-05-06"},{"milestone_name":"ADDRESS_COMPLETED","raised_at":"2019-05-06"}]
I need json object with keys :
email | rick#mail.com <br/>
milestones | { "PROFILE_COMPLETED":{"milestone_name":"PROFILE_COMPLETED","raised_at":"2019-05-06"}, "ADDRESS_COMPLETED":{"milestone_name":"ADDRESS_COMPLETED","raised_at":"2019-05-06"}}
You don't mention what version you are using, but this will work in recent versions:
select email,
json_object_agg(
milestone_name, json_build_object(
'milestone_name', milestone_name,
'raised_at', raised_at
)
)
FROM milestone
join customer on customer.app_id = milestone.app_id
GROUP BY email;
email | rick#mail.com
json_object_agg | { "ADDRESS_COMPLETED" : {"milestone_name" : "ADDRESS_COMPLETED", "raised_at" : "2019-05-06"}, "PROFILE_COMPLETED" : {"milestone_name" : "PROFILE_COMPLETED", "raised_at" : "2019-05-06"} }

What is the most elegant way of describing textually a table

Here is the situation. I am working in epidemiological research and describing tables is something we have to do on a day-to-day basis. Content editing tools and their associated language all offers ways to describe a table. Here are a few example :
Latex
\begin{center}
\begin{tabular}{ c c c }
cell1 & cell2 & cell3 \\
cell4 & cell5 & cell6 \\
cell7 & cell8 & cell9
\end{tabular}
\end{center}
HTML
<table style="width:100%">
<tr>
<td>Jill</td>
<td>Eve</td>
</tr>
</table>
Markdown
| Tables | Are | Cool |
| ------------- |:-------------:| -----:|
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
Some of these are clearer than others, but all of them start to look absolutely horrific once one try to modify their formating to something other than the most basic example.
My question is the following :
Given that this is one of the most fundamental tasks of text editing, what is the most elegant way/language we know to represent textually a non-trivial table and its content?

Logical operators in Selenium IDE

I need to check value of an attribute in Selenium IDE. But the value can be "ABC" or "XYZ" randomly.
How to use OR operator to check if the value is valid?
I tried glob with | character, but it does not work:
verifyAttribute | xpath=.//*[#id='content']/div/div[3]/div[2]/div[1]/div[2]/a[1]#href | glob:(ABC)|(XYZ)
Thanks in advance.
You can use regex
verifyText | your ID here | regex:[ABC]|[XYZ]
<tr>
<td>verifyText</td>
<td>your ID here</td>
<td>regex:[ABC]|[XYZ]</td>
</tr>
This will match either ABC or XYZ exactly

Where can I find the documentation for MicroStrategy Command Manager

Where can I find the documentation for MicroStrategy Command Manager? I've look through various docs that I have but not able to find any comprehensive list of commands. Particularly, I need to know a list of commands to create attributes and metrics.
Thanks
The best way to find the list of available commands is to use the Outlines option, available inside Command Manager.
To create an attribute use the following syntax:
CREATE ATTRIBUTE "<attribute_name>" [DESCRIPTION "<description>"] [LONGDESCRIPTION "<long_description>"] IN [FOLDER] "<location_path>" [HIDDEN (TRUE | FALSE)] ATTRIBUTEFORM "<form_name>" [FORMCATEGORY "<category_name>"] [FORMDESC "<form_description>"] [FORMTYPE (NUMBER | TEXT | DATETIME | DATE | TIME | URL | EMAIL | HTML | PICTURE | BIGDECIMAL | PHONENUMBER)] [REPORTSORT (NONE | ASC | DESC)] [BROWSESORT (NONE | ASC | DESC)] EXPRESSION "<form_expression>" [MAPPINGMODE (AUTOMATIC | MANUAL)] [EXPSOURCETABLES "<sourcetable1>" [, "<sourcetable2>" ...]] LOOKUPTABLE "<lookup_table>" FOR PROJECT "<project_name>";
and for metrics creation:
CREATE METRIC "<metric_name>" IN [FOLDER] "<location_path>" EXPRESSION "<expression>" [DESCRIPTION "<description>"] [LONGDESCRIPTION "<long_description>"] [HIDDEN (TRUE | FALSE)] [ALLOWSMARTMETRIC (TRUE | FALSE)] [REMOVEREPORTFILTERELEMENTS (TRUE | FALSE)] [TOTALSUBTOTALFUNCTION (AVERAGE | COUNT | DEFAULT| GEOMETRICMEAN | MAXIMUM | MEDIAN | MINIMUM | MODE | NONE | PRODUCT | STANDARDDEVIATION | SUM | VARIANCE)] [DYNAMICAGGREGATIONFUNCTION (AVERAGE | COUNT | DEFAULT| GEOMETRICMEAN | MAXIMUM | MEDIAN | MINIMUM | MODE | NONE | PRODUCT | STANDARDDEVIATION | SUM | VARIANCE)] [COLUMNALIAS "<columnalias>"] FOR PROJECT "<project_name>";
Some simple examples provided bellow (again from the outlines available inside command manager):
CREATE ATTRIBUTE "Day" DESCRIPTION "Duplicate of Day Attribute from folder \Time" IN FOLDER "\Schema Objects\Attributes" ATTRIBUTEFORM "ID" FORMCATEGORY "ID" FORMDESC "Basic ID form" FORMTYPE TEXT REPORTSORT ASC EXPRESSION "[DAY_DATE]" LOOKUPTABLE "LU_DAY" FOR PROJECT "MicroStrategy Tutorial";
CREATE METRIC "New Metric" IN FOLDER "\Public Objects\Metrics\Count Metrics" EXPRESSION "Count(Customer) {Country} <[Western United States Customers]>" FOR PROJECT "MicroStrategy Tutorial";
As Bruno said, the Outlines option gives you all the templates that there are in Command Manager, which you can build together and define to do what you want. If in doubt, check out the "MicroStrategy System Administration Guide" product manual, which covers all you need to know on command manager.
Here is one useful site with Command Manager documentation:
https://metacpan.org/pod/Business::Intelligence::MicroStrategy::CommandManager

Symfony2 custom form

I have form with checkboxes loaded from database (I use entity field type). Checkboxes are regions and districts. I have following database schema:
+-----------------------------------+
| id | parent_id | name |
+-----------------------------------+
| 1 | NULL | Region |
+-----------------------------------+
| 2 | 1 | District |
+-----------------------------------+
| 3 | 1 | Another district |
+-----------------------------------+
| 4 | NULL | Another region |
+-----------------------------------+
| 5 | 4 | Next district |
+-----------------------------------+
Problem is that I need following form. How to do that?
<b>Region</b><!-- Loaded from database -->
<!-- Dictricts ordered by name -->
<input type="checkbox" id="someId" value="3"><label for="someId">Another district</label>
<input type="checkbox" id="someId" value="2"><label for="someId">District</label>
<b>Another region</b><!-- Loaded from database -->
<!-- Dictricts ordered by name -->
<input type="checkbox" id="someId" value="5"><label for="someId">Next district</label>
Thanks to this post I've solve this by custom rendering form template.
EntityType field with options :
multiple = true
expanded = true
property = 'name'
class = 'YourBundle:YourEntity'
query_builder = 'function (EntityRepository $er) {return $er->createQueryBuilder('r')
->where('r.parentId IS NOT NULL')
->orderBy('r.parentId', 'ASC')->orderBy('r.name', 'ASC');}'