<No Name> Element

6 posts, 0 answers
  1. Peter
    Peter avatar
    15 posts
    Member since:
    Mar 2017

    Posted 28 Sep Link to this post

    Hi,

    Is it possible to get the element with <No Name>?

    Using "ByExpression" I need to get a value: "Value is too large [> 40]"

    I try to like this: 

    Example1:

    ContentPresenter searchScroll = WindowScreenActuarialAssumptions.MainWindow.Find.ByExpression(new XamlFindExpression("DataContext='Value is too large [> 40]'")).As<ContentPresenter>();

     

    Example2: 

                var txtBlock = WindowScreenActuarialAssumptions.MainWindow.Find.ByTextContent("");

     

     

  2. Elena Tsvetkova
    Admin
    Elena Tsvetkova avatar
    610 posts

    Posted 02 Oct Link to this post

    Hello Peter,

    Thank you for reaching us out. 

    Please find here additional details about the Find expression and how to build it in the Testing Framework here. I hope this would be helpful to you. 

    Though in case you would like further assistance please provide some screenshots of the attributes and properties of the required element and which are these you would like to use. 

    Thanks in advance! 

    Regards,
    Elena Tsvetkova
    Progress Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  3. Peter
    Peter avatar
    15 posts
    Member since:
    Mar 2017

    Posted 04 Oct Link to this post

    Hi, Elena,

     

    Thanks for the reply. I need to test for validation error. 

    Please see an example on the picture.

  4. Elena Tsvetkova
    Admin
    Elena Tsvetkova avatar
    610 posts

    Posted 09 Oct Link to this post

    Hello Peter,

    Thank you for getting back. 

    As of the screenshot provided and the previously shared information I would like to kindly ask for some further clarification. It seems that the text block does not have a name so this would not be an option to locate it. 

    Though the TextContent should be working if it is unique on the page. The approach you have listed should work if you include the actual TextContent: 

    var txtBlock = WindowScreenActuarialAssumptions.MainWindow.Find.ByTextContent("Element'sTextContent");

    Have you tried and what the result would be? 

    Please if you would need further assistance would it be possible to provide a sample application which contains such an element - this would be the easiest way to find a solution for the encountered difficulty. 

    Thank you in advance for the cooperation! 

    Regards,
    Elena Tsvetkova
    Progress Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  5. Peter
    Peter avatar
    15 posts
    Member since:
    Mar 2017

    Posted 10 Oct in reply to Elena Tsvetkova Link to this post

    Hi Elena,

    Yes, I found the solution :) Thanks for your help!

        WindowScreenActuarialAssumptions.MainWindow.RefreshVisualTrees();

                var warningMessageControl = WindowScreenActuarialAssumptions.MainWindow.Find.AllByType("TextBlock").Where(_ => _.TextLiteralContent.Contains("Value is too")).ToList();

    Regards,

    Peter

     

     

  6. Elena Tsvetkova
    Admin
    Elena Tsvetkova avatar
    610 posts

    Posted 10 Oct Link to this post

    Hi Peter,

    Thanks for your feedback. I am glad to know you found a suitable solution for you. 

    Regards,
    Elena Tsvetkova
    Progress Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
Back to Top