Test Role
The script will loop through the list and find 'Test Role'. At this point, it needs to click the delete link associated with this item. My current script always clicks the delete link for 'A role', which is the first one in the list. I cannot figure out how to make it click the delete link for 'Test Role'.
Does anybody have any suggestions? I have attached screen shots of the DOM and the UI and my current script is below.
Thanks!
HtmlUnorderedList roles = ActiveBrowser.Find.ById<HtmlUnorderedList>("Roles");
HtmlAnchor a = Find.ById<HtmlAnchor>("deleteRole");
//Loop through each <li>, find role and click the delete link
foreach(HtmlListItem item in roles.AllItems)
{
if (item.TextContent.ToString() == "Test Role")
{
Log.WriteLine(item.TextContent.ToString());
a.MouseClick();
}
}
Error: Wait for condition has timed outInnerException:System.Exception: Unable to find the target host (Browser/SilverlightApp) to locate an element. Failure: Waiting for frame '[Frame:id=credentials,name=Frame_1,src=https://<URL>,UseQuery:False]' timed out. Error: Wait for condition has timed out at ArtOfTest.WebAii.Design.Execution.ExecutionUtils.WaitForAllElements(IAutomationHost host, AutomationDescriptor descriptor, Int32 timeout) at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)
'1/8/2014 11:31:32 AM' - 'Fail' : 10. [Toelichting_CodedStep] : Rename PDF
------------------------------------------------------------
Failure Information:
~~~~~~~~~~~~~~~
Exception thrown executing coded step: '[Toelichting_CodedStep] : Rename PDF'.
InnerException:
System.IO.FileNotFoundException: Could not load file or assembly 'TestLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'TestLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
at ABN_AMRO_Internet.Toelichting.Toelichting_CodedStep()
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].