I have this command here in Selenium IDE to store a text in a variable:
Command: storeText
Target: //div[#id='content-main']/form[2]/table[5]/tbody/tr[td[1][contains(text(), 'Purchase')]]/td[2]
Value: variableName
As you can see, in this command it looks in the first column of the 5th table and search for the line where it says "Purchase" and stores the string content from the second column.
The problem is this: table[5]
There are some times where this table is not always the 5th table. So, I'd like to know if there is some way to search for this String that I'm looking for, but without the table number, so the command would first find the table number, and then find the string I'm looking for.
To make it easier, here is the HTML source of the page I'm doing my tests:
http://txtup.co/e9KYB
I accept suggestions to maybe do it in another way, what I need is to store the Purchase Type value that is in this page.
Just change table[5] to table. The full XPath will then be:
//div[#id='content-main']/form[2]/table/tbody/tr[td[1][contains(text(), 'Purchase')]]/td[2]
Related
This should be simple but it's just not working. I have a list of records that I want to display in the terminal without anything besides the list of record keys. No Headers, page gaps, etc. The problem is I can't get rid of the page gaps that keep chopping up my list.
SORT INVENTORY HDR.SUPP COL.HDR.SUPP NO.PAGE NO.SPLIT COUNT.SUP
You need to change your TERM settings, ignore the 'type' option.
Increase the TERM 'B' (HELP TERM) to the total number of records you are returning.
For example if the report contains 100 records, you enter:
: TERM [to get default settings]
: TERM 80,100,132,60
: run LIST/SORT
: TERM A,B,C,D [ use values from first TERM ]
You need to run the term command prior to running your select.
Just in case you're trying to get this list of bare keys so you can copy/paste it somewhere else (like Excel), I'll throw out another option that may be helpful and save some scrolling:
:sort INVENTORY TO DELIM 9 /tmp/inventory.txt
Will run your command and dump the output (tab-delimited, though that's irrelevant with only one field) to a file in the tmp directory.
:UDT.OPTIONS 91 ON
Is helpful if you're dumping dates, numbers or anything that needs output formatting.
UDT Options Command reference describes that:
UDT.OPTIONS 91 U_LIST_TO_CONV
affects saved queries on
data that is defined in the dictionary with a conversion code. For
example, when a date is defined as D4, the internal date is 9611,
which the conversion code translates as 04/24/94. UniData does not
convert the data before it saves UniQuery results to an ASCII file.
With UDT.OPTIONS 91, you can force the conversion before UniData saves
the ASCII file.
I am trying to show images for products inside a basic report. The image needs to be dynamic, meaning the image should change based on the SKU value.
Right now I am inserting an image into a table, setting to external, and i've tried:
=Fields!URL.Value
=http://externalwebservername/sku= & Fields!SKU.Value
="http://externalwebservername/sku=" & Fields!SKU.Value
I do not get any images in my table.
My stored proc has all the data, including a URL with the image I wan't to show. Here is a sample of what the URL looks like:
http://externalwebservername/sku=123456
If I enter the URL in the field without "=" it will show that ONE image only.
How should I set up the expression to properly show the external image based on a dynamic URL? Running SQL 2016
Alan's answer should work, but in our environment we have strict proxy/firewall rules, so the two servers could not contact each other.
Instead we are navigating to the file stored on our storage system.
We altered the URL column to point to file path in the stored procedure. Insert image, set Source to External and Value set to [URL].
URL= file://server\imagepath.jpg
As long as the account executing the report has permissions to access the URLs then your 3rd expression should have worked.
I put together a simple example as follows.
I created a new blank report then added a Data Source. It doesn't matter where this points, we won't use it directly.
Then I created a dataset (Dataset1) with the following SQL to give me list of image names.
SELECT '350x120' AS suffix
UNION SELECT '200x100'
UNION SELECT '500x500'
Actually, these are just parameters for the website http://placehold.it/ which will generate images based on the size you request, but that's not relevant for this exercise.
We'll be showing three images from the following URLs
http://placehold.it/350x120
http://placehold.it/200x100
http://placehold.it/500x500
Next, create a table, I used 3 columns to give me more testing options. Set the DataSetName to DataSet1 if it isn't already.
In the first column the expression is just =Fields!suffix.Value
In the second column I added an image, set it's source property to External and the Value to ="http://placehold.it/" & Fields!suffix.Value
I then added a 3rd column with the same expression as the image Value so I could see what was being used as the image URL. I also added an action that goes to the same URL, just to check the URL did not have any unprintable characters in it that might cause a problem.
The basic report design looks like this.
The rendered result looks like this.
I have been developing a web application using domino, therein I have dblookup-ing the field from notes client; Now, this is working fine but the format of value is missing while using on web.
For example in lotus notes client the field value format is as above
I am one, I am two, I am one , I am two, labbblallalalalalalalalalalalalalalalalalalaallllal
Labbbaalalalallalalalalalaalallaal
Hello there, labblalalallalalalllaalalalalalalalalalalalalalalalalalalalalalalala
Now when I retrieve the value of the field on web it seems it takes 2 immediate after 1. and so forth, I was expecting line feed here which is not happening.
The field above is multi valued field. Also on web I have used computed text which does db lookup from notes client.
Please help me what else could/alternate solution for this case.
Thanks
HD
Your multi-valued field has display options associated with it and the Notes client honors those. Obviously, your options are set up to display entries separated by newlines.
The computed text that you are using for the web does not have options like that and the field options are irrelevant because you aren't displaying the field. Your code has to insert the #Newlines. That's pretty easy because #DbLookup returns a list, and if you concatenate a list and a scalar, the scalar will be appended to each element of the list. (Look at the third example under "concatenation, pairwise" here to see what I mean.
The way you've worded your question is a little unclear to me, but what you need in your computed text formula is either something like this:
list := #DbLookup(etc,. etc.);
list + #Newline;
Or something like this:
multiValueFieldContainingListWithDbLookupResult + #NewLine;
I used #implode(Dblookupreturnedvalue;"");
thanks All :)
I making a virtual assistant client for my University project and there is a slight problem in getting a tag return based on match string.
The system works like this:
1. The user speech input is converted into a string.
2. The string is then matched to column in table.
3. The matching column returns its id which then return two tags from another table.
The problem is for calling someone, how should I go around it?
I mean, the user will say something like this: "Call Arya", here I can't have predefined command for each person so I have to use "MATCH" or "LIKE" selectors in SQL.
But then if I use these selectors then it will return me the tag for say opening facebook app even if I just "facebook", as the commands for facebook will be "open facebook" or "run facebook".
So how to work around it. Please help.
I have a column in Excel of domain names (like stackoverflow.com) and would like to create a corresponding column with the title of the domains (like "Stack Overflow").
I uploaded the Excel file into OpenRefine. I believe the best way to do this would be to call the "Add column by fetching URLs on column" function. But I don't know what expression to use.
The way I do it is as follows:
(1) Have visitable URLs in the source column. I.e., http://stackoverflow.com instead of just the domain name.
(2) Apply "Add column by fetching URLs..." as you said. (If you're hitting pages on the same domain over and over, make sure you set a reasonable delay.)
(3) Using this first new column, create a second new column based on newCol1 by parsing the HTML that's returned:
value.parseHtml().select("title")[0].toString()
Notes:
(a) You need the toString() else you'll see blank values in the new column after you apply the function.
(b) You don't have to create a second new column; you could just apply a transform using the same formula as above.
(c) I've also tried using a split:
value.split("")[1].split("")[0]
I don't have my results handy at the moment, but I believe that also worked.