Comparing image in Jtable
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2014
03:03 PM
08-20-2014
03:03 PM
Comparing image in Jtable
I have Jtable with rows and columns, The Image icon is Stop (red colour) and Go green colour.
I want to click the row only when the particular cell has green icon.
I am using Testcomplete/javascript
Application is desktop using java.
Anyone has done this before?
I want to click the row only when the particular cell has green icon.
I am using Testcomplete/javascript
Application is desktop using java.
Anyone has done this before?
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2014
08:44 PM
08-25-2014
08:44 PM
Hi Zaheer,
The pseudocode of the comparison function can look like this:
// get the cell with the image by its row and column
var cell = ...
// save the currently displayed icon
var curImage = cell.Picture()
// get the image for the comparison. It can be stored in Stores
var desiredImage = Regions.GetPicture("StoredImageName")
// compare if the current and the desired images are the same
if (curImage.Find(desiredImage)
{
Log.Message("The cell contains the desired icon")
}
I suggest that you read the "Finding an Image Within Another Image" article for details.
The pseudocode of the comparison function can look like this:
// get the cell with the image by its row and column
var cell = ...
// save the currently displayed icon
var curImage = cell.Picture()
// get the image for the comparison. It can be stored in Stores
var desiredImage = Regions.GetPicture("StoredImageName")
// compare if the current and the desired images are the same
if (curImage.Find(desiredImage)
{
Log.Message("The cell contains the desired icon")
}
I suggest that you read the "Finding an Image Within Another Image" article for details.
---------
Tanya Yatskovskaya
SmartBear Community and Education Manager
Tanya Yatskovskaya
SmartBear Community and Education Manager
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2014
11:29 AM
08-26-2014
11:29 AM
Hi Tanya, Thanks for reply.
I tried to get the cell with the image value for column/row using following code
I tried to get the cell with the image value for column/row using following code
var cell = table.getCell(row, column) / var cell =table.getvalueAt(row, column)
I dont get any value back hence the next statment
var curImage = cell.Picture()
fails
Do you have any idea how do i get cell witht the image by its row and column.
