There is a breadcrumb in our web application which gets updated with new text when we click few links on the page. I need to verify that the breadcrumb gets updated with new text after I click on a link.
Now, my old code is
Code: Select all
myOR.Home.myLink.click();
Delay.Seconds(3);
if(myOR.Home.BreadCrumb.InnerText=="exptext"){ return success;}
So, I've improved the code.. by updating OR item's properties at run-time.
Code: Select all
myOR.Home.myLink.click();
string text = "exptext";
string BreadCrumbPath = myOR.Home.BreadCrumbInfo.Path.ToString();
BreadCrumbPath = BreadCrumbPath.Substring(1, BreadCrumbPath.Length-2);
BreadCrumbPath += " and @InnerText='" + text + "']";
myOR.Home.BreadCrumbInfo.Path = BreadCrumbPath;
obj = Host.Local.FindSingle(myOR.Home.BreadCrumbInfo.AbsolutePath, 10000);
if(obj.Exists()){ return success;}
[NOTE]: Code in this post is just pseudo code.
Thanks,
Suraj