How to return source image value in selenium IDE? - selenium-ide

I want to make a script in which i just give the location where image is present and it will return the source of image which can be compared with actual value.

If I understand what you are asking, such thing is impossible in Selenium. Selenium interacts with the page DOM and can't detect page contents based on location.
If you want to verify image existence, there are appropriate ways to do so. You have to find it using various locators available in Selenium and then you can run an isDisplayed() query on it for example.

Check this out:
open | http://hello.com
storeEval | window.document.getElementById('folio').getAttribute('src') | source
echo | ${source}
So it is possible to get source of the image using javascript. But you need to find element using javascript not just location.
If you will provide an HTML code of your page (part with image) or page address I will add code that will fit your needs.

Related

Input field data is visible to the user but apparently invisible to Chrome Dev Tools? How can I get at it?

Since I know Cypress, I offered to help a friend screen scrape data out of a legacy system for which he no longer has database access, but I seem to be at a dead-end.
The PHP code fills the form fields somehow, and I can cut'n paste from them into an editor but, when I try to automate that, the input field's innerText is always empty strings. I can use Dev Tools to search the DOM and find the text of the field labels, but searching for the input field text turns up nothing.
Is there really no way to get at that data?
How can Chrome be unable to find data that it is actually displaying?
Is this some kind of security barrier?

How to get array of pixels from browser window without using canvas

I'm attempting to get an array of pixels of the screen (web page) but i know of no way of doing that without using canvas (either straight-up or converting HTML dom elements into canvas, first). I need to capture every pixel on the screen and i don't know what operating system is going to be used so i can't request the display from the O/S, either. Is there a third-party tool, possibly, or a way to do this from the window object in the DOM?
I have only one idea. Maybe you should try to move this functionality to the server. You can use WkHtmlToPDF(http://wkhtmltopdf.org/) for saving websites as PDF, pdf file you can convert to an image and read pixels array.
As web developers with no control of the client machine, there's two approaches to getting a screenshot of a webpage:
Open the webpage in a headless browser on the server and make the screenshot there. phantomjs is a popular one.
(I'm including this for completeness, though you said you don't want to take that route): Use the canvas element on the client. html2canvas is an interesting project that re-renders an entire HTML document into a canvas element so a screenshot can be made.
If your use case allows it, you could of course instruct your users to take a screenshot and paste it in an upload form that can handle images from the clipboard. On Windows, that's a matter of hitting "Print Screen" and CTRL+V.
Here is an api to generate images from online web pages: http://www.page2images.com/Create-Website-Screenshot-with-Javascript-API

Automation of clicks on webpage using Matlab

So I'm looking for a way to systematically access data from a website. This data is updated every 15 minutes or so, and is generated through a datamart system that makes custom reports following several input parameters: the desired date interval, the specific dataset.
All these parameters require me to click on some specific buttons; I was wondering if it would be possible to automate these click inputs using Matlab (or something else if need be), to retrieve the data and treat it automatically.
Thanks in advance!
I suggest you take a look at http://www.autohotkey.com/. This is a great tool which allows for the automatic clicking on any window (including a browser page) under Windows. It even will let you "search" your screen for pixel images and then click on those images. This would allow you to make a very small bmp file of the link you would like to click on, and then your script can search your page and click directly on the link.
As far as getting data into matlab I'm not exactly sure of the best way to do this, but you might consider saving the html of the page, and then parsing that from matlab.

cannot find image of webite header in joomla

Am just beginning with joomla on a site that is already existing and was previously managed by someone else who is not available at the moment. I am trying to troubleshoot a problem why the website is displaying the header differently in different PCs but I am not being able to find the image of that header file. I tried to look for it under "site > media" but cannot find the image among the images in that area. I also tried to look for the path to the image through the template css and found this path ../images/logo.png which I believe must be the path to the header image but I honestly don't really know which path ../images/logo.png is but assuming it is the one under "media" then I still cannot find the image. Could you give me a clue on where the header image files could be found cause I've actually still failed? Or, could you make me understand this path ../images/logo.png or how to find an image on a joomla admin interface like say "logo.png". In fact I discover that on looking at the CSS for the template, the image paths found in it are not found in "Media"? Is there another path for the images in the template and how do I access them? I cannot FTP my host at the moment to view the physical files due to the long procedure needed so am hoping that there is a way to find it. I only have joomla admin access and nothing like Cpanel as yet. The joomla version of the site is 1.5.22 which I know is an old one but I plan to do first things first. Hope I've given enough infor.
Try using FireBug, or Chrome debugger - (press F12) and check "Click an element in the page to inspect" to see where the specific image is located exactly.

Uploading an image in Zend Framework

I am new in Zend Framework and learning it. I want to upload image into my database and display that image in view page. I search lots of tutorial but no step by step guidance. Want a help. Thanks in advance.
You need to take a look on Zend_Form_Element_File in Zend documentation:
The File form element provides a mechanism for supplying file upload
fields to your form. It utilizes Zend_File_Transfer internally to
provide this functionality, and the FormFile view helper as also the
File decorator to display the form element. By default, it uses the
Http transfer adapter, which introspects the $_FILES array and allows
you to attach validators and filters. Validators and filters attached
to the form element are in turn attached to the transfer adapter.
Database side, you need to use a BLOB type to hold your image (I assume you're using MySQL).
However, note that best practices are to store the image path in the database instead of the image itself.
At last, there are tons of tutorials out there that explains precisely how to do what you're looking for, you just need to look for "file upload using zend element file" and you will find them!