Hello, there is a problem.
Code:
HtmlSpan span = row.Cells[5].Find.ByTagIndex<HtmlSpan>("span", 0);
if (span != null)
{
try
{
Utility.LogMessageToFile("color = " + span.GetComputedStyle("color").Value);
Utility.LogMessageToFile("cursor = " + span.GetComputedStyle("cursor").Value);
Utility.LogMessageToFile("font-size = " + span.GetComputedStyle("font-size").Value);
Utility.LogMessageToFile("text-align = " + span.GetComputedStyle("text-align").Value);
Utility.LogMessageToFile("background-color = " + span.GetComputedStyle("background-color").Value);
}
catch (ExecuteCommandException ex)
{
Utility.LogMessageToFile(ex.Message);
}
}
the row variable is KendoGridDataItem
And the result below:
28-MAY-2019, 10:30:29.245: color = rgb(255, 255, 255)
28-MAY-2019, 10:30:29.266: cursor = default
28-MAY-2019, 10:30:29.286: ExecuteCommand failed!
BrowserCommand (Type:'Information',Info:'ComputedStyle',Action:'NotSet',Target:'ElementId (tagName: 'span',occurrenceIndex: '12')',Data:'font-size',ClientId:'05eb9dc2-082a-46e6-abdc-18f196ca3092',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'False',Response:'')
InnerException: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at ArtOfTest.WebAii.Messaging.Process.WebDriverCommandProcessor.GetComputedStyle(BrowserCommand command)
at ArtOfTest.WebAii.Messaging.Process.WebDriverCommandProcessor.ProcessInformationCommands(BrowserCommand request)
at ArtOfTest.WebAii.Messaging.Process.WebDriverCommandProcessor.ProcessCommand(BrowserCommand request)
at ArtOfTest.WebAii.Messaging.Process.BrowserWebDriverRemoted.ProcessBrowserRequest(BrowserCommand command, String requestId)
at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)
As you see styles without '-' is got successfully but with it "The given key was not present in the dictionary."
I tried all styles are contained in the code.
IE, Chrome, Firefox get this successfully.