TanIlak
2 years agoContributor
Log Functions
Hi I am trying to display the google logo in log file using Log.Picture() method >> var img=page.FindElement("xpath"); Log.Picture(img); In this way but it's not printing in log. Am I did any...
Sorry I was confused with another program. Here is the right solution.
To display the Google logo in the log file using the Log.Picture() method, you need to make sure that you are passing the correct element to the method.
Here is an example of how you can display the Google logo in the log file:
First, use the TestComplete DOM methods to find the Google logo element on the page. For example, you can use the "FindElement" method to search for the element using its xpath or any other attribute.
Once you have found the element, you can use the "GetImage" method to get the image of the element as a bitmap.
Finally, pass the bitmap to the Log.Picture() method to display it in the log file.
Here is an example code snippet that demonstrates how to do this:
// Find the Google logo element
var logoElement = page.FindElement("xpath", "//img[@title='Google']", 10);
// Get the image of the logo element as a bitmap
var logoImage = logoElement.GetImage();
// Display the logo image in the log file
Log.Picture(logoImage);