UFT wont load URL where uniquekey in passed through Gloabal datatable - uft14

I am using UFT to load a set of URLs.
Each URL has a unique number which i am passing through datatable.
This unique number is at the end of the URL (suffix).
After loading each URL, i need to take screenshot.
My issue is with loading the URL. It wont load.
sample URL: https://www.pslmssn.com/USPExceptions/id=46465
code
abc=https://www.pslmssn.com/USPExceptions/id={unique id}
Dim p
For p = 1 to 100
Datatable.SetCurrentRow(p)
Browser("KAJL").WinEdit("URL").Set ("abc"& DataTable("UniqueID", dtGlobalSheet))
Anything i need to add/update in code. Would appreciate suggestions

Related

Dynamically generate url for HTTP source

I'm trying to call a http endpoint. For that I need to specify a url that uses a query string to filter data.
Sample URL: http://example.com?date=2017-10-04T22:18.007Z
I need to use the current system time as a value for date query string.
I created a script and assigned the generated url with the current datetime to a variable. However, when I assigned that variable for the url field in the source HTTP definition, it did not resolve the variable.
Is there a way to solve this issue?
I do this all the time. As long as your script is running properly (you can test that with the test feature on the script), you are writing the URL value to a global variable (something like $URL), and you are writing that global variable out in your target (something like [URL]), it should work.
If you want to show your script (just where you are creating the URL), and your target URL field that could help narrow down the problem.

SSRS - How to show external image based on URL inside column

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.

How to get variation specific image from a listing with eBay API GetItem

I'm trying to get variation images, I have tried multiple things and nothing seems to work out.
I have one variation on all my listings called size. Within this I have Small, Medium, Large, Set of 3.
I have managed to get the main image with this code:
Dim fetchedItem As ItemType
Dim Apicall As GetItemCall = New GetItemCall(Context)
Apicall.DetailLevelList.Add(DetailLevelCodeType.ReturnAll)
fetchedItem = Apicall.GetItem(myItemID)
Dim imageURL As String = fetchedItem.PictureDetails.GalleryURL.ToString()
Try using a different API call: GetSingleItem. You can either POST or GET your API request. http://developer.ebay.com/DevZone/shopping/docs/CallRef/GetSingleItem.html
Be sure to use an IncludeSelector for additional data in the response.

How to pass some information between parse_item calls?

Ok, imagine a website with some list. The items of this list have one piece of information needed. The second piece is located at some other url, which is unique from item to item.
Currently our crawler opens a list page, scrapes each item, and for each item it opens that 2nd URL and gets the 2nd piece of the info from there. We use requests lib which is excellent in almost all cases but now it seems to be slow and ineffective. It looks that the whole Twisted is being blocked until one 'requests' request ends.
pseudo-code:
def parse_item():
for item in item_list:
content2 = requests.get(item['url'])
We can't just let Scrapy parse these 2nd urls because we need to 'connect' the first and the second url somehow. Something like Redis would work, but hey, is there any better (simpler, faster) way to do that in Scrapy? I can't believe the things must be so complicated.
You can do this my passing variable in meta
For example:
req = Request(url=http://somedonain.com/path, callback=myfunc)
req.meta['var1'] = 'some value'
yeld(req)
And in ur myfunc, you read passed variable as:
myval = response.request.meta['var1']

Set the header for PDF document on second page

I have a jsp page that contains some data(This data may very because it is fetches from the data base) over it.Now I am generating the PDF file for the my jsp page using the ‘Itext api’ . Now I need to set the some specific header on this generated pages started from the Page 2 onwards.
For Ex :-
Test.jsp
Jsp test page contains the data for testing purpose.
Test.pdf
Jsp test page contains the data for testing purpose.
……
…
Page 1 ends
Page 2 starts
My title for the page..(Only needed for the second page onwards)**
Please help me...
Thanks in advance
You can probably make use of setSkipFirstHeader(boolean) of PdfPTable. Which will not print out the first occurrence of the header of your table. You will need to be sure to setHeaderRows on the table.
You could also subclass the PdfPageEventHelper and in the onEndPage event, use the passed in Document object to getPageNumber(). When you determine it is past the first page, you can add your header content to the document.