Hello,
I'm getting some strange problem since I updated my FireFox from 3.5.5 to 3.6.3 last week. When I'm looking for element like this :
<span xmlns="" class="label_url_addDiscount_constant">
<a href="/PA_Klient_Finanse_Rabaty_DodajRabat_Staly.html?clientID=456083">
<img border="0" src="/buttons/pierwszy/dodaj rabat stały.gif" alt="dodaj rabat stały"/>
</a>
</span>
using code similiar to
Element el = find.ByExpression("alt=dodaj rabat stały");
actions.Click(el);
i got exception
'2010-05-05 10:21:54.265 ' - [Trace] : Exception: ExecuteCommandException Message: ExecuteCommand failed!
InError set by the client. Client Error:
mozCommandProcessor: FindElement(): Tag collection is either empty or has less elements than the element occurrence requested.TagName: a4:img, Occurrence Requested: 0, All Tags Collection length: 0
BrowserCommand (Type:'Information',Info:'ElementRectangle',Action:'NotSet',Target:'ElementId (tagName: 'a4:img',occurrenceIndex: '0')',Data:'',ClientId:'Client_4a2adc76-44ce-4b9e-8e28-1c16bc02a364',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'mozCommandProcessor: FindElement(): Tag collection is either empty or has less elements than the element occurrence requested.TagName: a4:img, Occurrence Requested: 0, All Tags Collection length: 0')
InnerException: none.
This happend only in FireFox 3.6.3 in older FF version (3.5.5) everything is fine.
IList
<FrameworkElement> elmnts = grid.Find.AllByType<FrameworkElement>();
I neded this if i am automating any customUserControl which was developed by someone else and i dont know anything about the controls used in that.
So i need to know all the elements in that control.
Also can you suggest some tools to see the visual tree like UISpy.
var ed2 = Find.ByCustom<Telerik.WebAii.Controls.Html.RadEditor>(a => a.ID.EndsWith("MqTelerikEditor"));
Assert.IsNotNull(ed2, "Did not find the editor");
const string html = "Test Code";
ed2.Html = html;
This test fails on the last line with this exception and stack dump.
ArtOfTest.WebAii.Exceptions.ExecuteCommandException : ExecuteCommand failed!
InError set by the client. Client Error:
System.InvalidOperationException: Javascript call [$find(\'ctl00_cContent_ctl00_MqTelerikEditor\').set_html(\'Test Code\')] failed! Please make the function exists and the call is using the correct prototype signature. Javascript error: [object Error]
at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeFunction(String functionCall, Boolean useEval, Boolean returnJSON)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)
BrowserCommand (Type:'Action',Info:'NotSet',Action:'InvokeJsFunction',Target:'ElementId (tagName: '',occurrenceIndex: '-1')',Data:'$find(\'ctl00_cContent_ctl00_MqTelerikEditor\').set_html(\'Test Code\')',ClientId:'Client_0f07abc3-99d2-47b2-aa1e-aa5d60203816',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.InvalidOperationException: Javascript call [$find(\'ctl00_cContent_ctl00_MqTelerikEditor\').set_html(\'Test Code\')] failed! Please make the function exists and the call is using the correct prototype signature. Javascript error: [object Error]
at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeFunction(String functionCall, Boolean useEval, Boolean returnJSON)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')
InnerException: none.
I am guessing there is a miss match with the Translator and that I need a 2010.2 version. Is this due?
When I watch the test run I see the content of the Editor does take the new content just before it crashes out.
John.
public
void
ClickButtonByGUICaption(String buttonGUIName)
{
StringBuilder buffer =
new
StringBuilder();
buffer.Append(
"//input[@value=\""
)
.Append(buttonGUIName)
.Append(
"\"]"
);
Manager.ActiveBrowser.Find.ByXPath<HtmlInputSubmit>(buffer.ToString()).Click();
Manager.ActiveBrowser.WaitUntilReady();
}
private void filtersSerialization()
{
var param = new FindParam(FindType.Content, "p:My Solutions Ltd",
new[] { "onclick=~document.getElementById('cancel_return').value = '1';"});
var paramCol = new FindParamCollection
{
{ "Sample", param }
};
paramCol.Save(@"d:\AppParams.xml");
}
<
FindParamItem
key
=
"Sample"
>
<
FindParam
TagName
=
"a"
XPath
=
""
NodeIndexPath
=
""
Type
=
"Content"
ContentType
=
"TextContent"
ContentValue
=
"p:My Solutions Ltd"
TagOccurrenceIndex
=
"-1"
>
<
Attributes
/>
<
PartialAttributes
>
<
iAttribute
Name
=
"onclick"
Value
=
"document.getElementById('cancel_return').value = '1';"
/>
</
PartialAttributes
>
</
FindParam
>
</
FindParamItem
>
<
iAttribute
Name
=
"onclick"
Value
=
"document.getElementById(\'cancel_return\').value = \'1\';"
/>