Edge browser can't a get computed style of an element if one contains a dash '-'

5 posts, 0 answers
  1. Ivan
    Ivan avatar
    21 posts
    Member since:
    Jul 2016

    Posted 27 May Link to this post

    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.

  2. Ivan
    Ivan avatar
    21 posts
    Member since:
    Jul 2016

    Posted 27 May in reply to Ivan Link to this post

    Forgot to write versions

    Test Studio 2019.1.212.0

    Windows 10, version: 1809, OS build: 17763.529

    Microsoft Edge 44.17763.1.0

    Microsoft EdgeHTML 18.17763

    WebDriver 10.0.17763.1

  3. Plamen Mitrev
    Admin
    Plamen Mitrev avatar
    90 posts

    Posted 28 May Link to this post

    Hello Ivan,

    Thank you for sharing details about your environment and code.

    I believe that LogMessageToFile() is a custom method and I am not sure what kind of logic is behind it. It is not part of Telerik Testing Framework and I am not able to reproduce the misbehavior. I want to help you and to do that I will need your help. Please share additional details on the topics below.
    • A sample test against a public application that reproduces the misbehavior. This will allow me to run the test on my end and investigate it further. 
    • I will have to reference the custom assembly in the test project. Please attach the .dll that contains the Utility class and LogMessageToFile() method.

    I am looking forward to hearing from you.

    Regards,
    Plamen Mitrev
    Progress Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
  4. Ivan
    Ivan avatar
    21 posts
    Member since:
    Jul 2016

    Posted 28 May in reply to Plamen Mitrev Link to this post

    Hello Plamen Mitrev,

    I attached a test project.
    Just run a test list.
    My results in the archive.
    I hope it will help.

  5. Plamen Mitrev
    Admin
    Plamen Mitrev avatar
    90 posts

    Posted 28 May Link to this post

    Hello Ivan,

    Thank you for the test project that reproduces the misbehavior against a public page.

    I have analyzed the test execution and I created a public bug report item on your behalf. We will investigate the issue further on our side and plan to fix it in our future releases. Please understand that at this point I am not able to promise you when the bug will be fixed.

    Thank you for your feedback.

    Regards,
    Plamen Mitrev
    Progress Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top