Clicking and comparing images from multiple websites
Posted: Thu Mar 14, 2013 10:18 am
Hi guys,
I'm in the process of trying to figure how to make the automation find all the HTML image tags in a set section and clicking on the image; there's a built in loop so that it navigates back to the same page ready to click on the next image tag. Once on the new page, I'm then trying to compare an image within this section to that of another website to ensure they are the same.
Code so far:
That was working but now it won't let me implicitly make IList<string> ImageList a string using ToString.
Any thoughts on both how to resolve my above issue, as well the brick wall I've hit above the code, would be greatly appreciated.
cheers
I'm in the process of trying to figure how to make the automation find all the HTML image tags in a set section and clicking on the image; there's a built in loop so that it navigates back to the same page ready to click on the next image tag. Once on the new page, I'm then trying to compare an image within this section to that of another website to ensure they are the same.
Code so far:
Code: Select all
Report.Info(repo.SmartTestWeb.parentSection.GetPath().ToString());
IList<string> ImageList = repo.SmartTestWeb.Self.FindDescendants<Ranorex.ImgTag>().ToString();
foreach(Ranorex.ImgTag currentImage in ImageList)
{
if(currentImage.ToString().Contains("_sm") == true)
{
Report.Info(string.Format("Clicking on {0}", currentImage.ToString()));
currentImage.Click(Location.Center);
Thread.Sleep(3000);
//Compare images
<code was here until I broke it somehow>
//Navigate back to About Us
repo.SmartTestWeb.MenuBar.Banner1.MoveTo();
repo.SmartTestWeb.MenuBar.DropBanner1.Click();
Thread.Sleep(3000);
Any thoughts on both how to resolve my above issue, as well the brick wall I've hit above the code, would be greatly appreciated.
cheers