by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Hiren Barad
    @baradhiren
    Hey @YevgeniyShunevych ,
    I was not aware that the FileInput control can handle os based popups as well. But I have tried it with the following method:
    using System.Windows.Forms;
    
    SendKeys.SendWait(FilePath);
    SendKeys.SendWait("{Enter}");
    Hiren Barad
    @baradhiren

    Hello Everyone, I have a question about KendoGrids.

    I have a column that contains buttons. Sometimes the column called Action might have one button called Edit. While sometimes it can have Edit and Delete. I want to click on a particular records Action buttons. Any way I can implement this? If I want to make a generic control for this kind of grid then is it possible? Thanks in advance.

    Yevgeniy Shunevych
    @YevgeniyShunevych

    Hey. I mostly just define the button properties inside row control class:

    using Atata;
    using Atata.KendoUI;
    
    namespace SampleApp.UITests
    {
        using _ = SomePage;
    
        public class SomePage : Page<_>
        {
            public KendoGrid<CarRow, _> Cars { get; private set; }
    
            public class CarRow : KendoGridRow<_>
            {
                public Text<_> CarMake { get; private set; }
    
                public Text<_> CarModel { get; private set; }
    
                public Button<CarEditPage, _> Edit { get; private set; }
    
                public Button<_> Delete { get; private set; }
            }
        }
    }

    By default buttons will be found by their text ("Edit" and "Delete") inside the coresponding <tr> row.

    Yevgeniy Shunevych
    @YevgeniyShunevych
    And if you want to extract these buttons to base row control class for reuse, you can easily do it this way:
    using Atata;
    using Atata.KendoUI;
    
    namespace SampleApp.UITests
    {
        using _ = SomePage;
    
        public class SomePage : Page<_>
        {
            public KendoGrid<CarRow, _> Cars { get; private set; }
    
            public class CarRow : EditableGridRow<CarEditPage, _>
            {
                public Text<_> CarMake { get; private set; }
    
                public Text<_> CarModel { get; private set; }
            }
        }
    
        public class EditableGridRow<TEditPage, TOwner> : KendoGridRow<TOwner>
            where TEditPage : PageObject<TEditPage>
            where TOwner : PageObject<TOwner>
        {
            public Button<TEditPage, TOwner> Edit { get; private set; }
    
            public Button<TOwner> Delete { get; private set; }
        }
    
        public class CarEditPage : Page<CarEditPage>
        {
        }
    }
    Hiren Barad
    @baradhiren
    Thanks @YevgeniyShunevych , That's really helpful.
    Hiren Barad
    @baradhiren
    Hello Everyone, I have a hidden text element and I want to validate its value. I am thinking about executing a script using JavascriptExecutor. Any suggestions on how should I do it with Atata?
    Zoltán Lehóczky
    @Piedone
    Hi everyone! Do the WebDriverExtras, e.g. Get(), have any kind of events, like do something on failure? It doesn't seem so to me.
    Yevgeniy Shunevych
    @YevgeniyShunevych
    Hey @Piedone . There are no events. But you can, for example, safely (without exception) execute Get and do something custom if it returns null.
    var element = Driver.Get(By.Id("some-id").Safely());
    
    if (element == null)
    {
        // TODO: Something...
    }
    Yevgeniy Shunevych
    @YevgeniyShunevych
    Hey @baradhiren. You can even do it without JavaScript. Yes, by default WebDriver and Atata return an empty string as a text of hidden element. But in Atata you can override that useing ContentSource. Here is the sample:
    [FindById("hidden-div", Visibility = Visibility.Hidden)]
    [ContentSource(ContentSource.TextContent)]
    public Text<_> HiddenDiv { get; private set; }
    page.HiddenDiv.Should.Equal("expected text");
    Atata.WebDriverExtras 1.3.0 is released by the way. Stay tuned for Atata 1.5.0 release.
    Zoltán Lehóczky
    @Piedone
    Thank you Yevgeniy!
    Yevgeniy Shunevych
    @YevgeniyShunevych
    Welcome.
    Hiren Barad
    @baradhiren
    Screenshot_2020-04-23 Index - Five Lakes Analysis Application.png
    Thanks @YevgeniyShunevych. I had one more question on KendoGrids. I have a column as shown in the above screenshot.
    public Text<TOwner> CdtCode { get; private set; }
    
    public Text<TOwner> TwentyFivePercent { get; private set; }
    
     public Text<TOwner> ThirtyPercent { get; private set; }
    
     public Text<TOwner> FourtyPercent { get; private set; }
    But the test is not able to find any of the columns when I run the tests? Am I doing anything wrong here?
    Yevgeniy Shunevych
    @YevgeniyShunevych
    Atata 1.5.0 is released with new controls, enhanced FindAttribute functionality, log4net support and other new useful features
    Hey @baradhiren. Could you please share a piece of HTML of your table header? Also please share exception message.
    Hiren Barad
    @baradhiren
    Hey @YevgeniyShunevych, Here are the screenshots.
    Screenshot (17).png
    Screenshot (18).png
    Let me know if you need anything else.
    Yevgeniy Shunevych
    @YevgeniyShunevych
    Atata tries to find column header with the text exact equal to the control term. But I can assume that filter icons in each column header can be represented as extra text character. I would try to change the term match from Equal to Contains. Just like here:
    [TermFindSettings(Match = TermMatch.Contains, TargetAttributeType = typeof(FindByColumnHeaderAttribute), TargetAnyType = true)]
    public class SomeRow : KendoGridRow<_>
    {
    //...
    }
    Hiren Barad
    @baradhiren
    Screenshot (20).png
    Screenshot (19).png
    image.png
    Hey @YevgeniyShunevych , I did try that out. But still no luck.
    Yevgeniy Shunevych
    @YevgeniyShunevych
    Hiren Barad
    @baradhiren
    Hey @YevgeniyShunevych , I did some more digging by modifying my custom grids. I think the issue is with the k-grid-toolbar which contains two buttons to export data as excel and pdf. Any suggestion on what will be an ideal solution to identify those two buttons and separate them from the columns.
    Because by looking at the exception it seems like atata is trying to look for the CdtCode column data but only finds two text values which are EXPORT TO EXCEL and EXPORT TO PDF
    This is the source for the toolbar
    Screenshot (21).png
    Also, if you can just guide me in the right direction. I have gone through the docs and source code but not able to connect some dots. Thank you again for all the support.
    Yevgeniy Shunevych
    @YevgeniyShunevych
    Hey @baradhiren. Strange a bit. It is hard to say what's wrong, until I cannot see complete HTML of the page. I see 2 options:
    1. You can share (can chat me directly) whole HTML source of the page with the grid.
    2. If columns in this grid are always located in the same order you can use FindByColumnIndexAttribute to find the column directly by it's index and not by column header text. You will need to apply this attribute with corresponding index to each property of grid row class like below:
    [FindByColumnIndex(0)]
    public Text<TOwner> CdtCode { get; private set; }
    Hiren Barad
    @baradhiren
    Hello, Me again. I have a situation in kendogrid where I am editing a column value after clicking on edit button. Is it any way possible to manage this in Atata. For reference please find attached screenshot.
    Screenshot (22).png
    Hiren Barad
    @baradhiren
    Nevermind, got it by using a combo of findbyclass and findbyid. :)
    Yevgeniy Shunevych
    @YevgeniyShunevych
    Atata.KendoUI 1.3.0 is released with new KendoAutoComplete control and several enhancements
    Yevgeniy Shunevych
    @YevgeniyShunevych
    uchagani
    @uchagani
    Is there a way to generate reports aside from the log output?
    Oleksandr Pidhainyi
    @alexdefine
    @uchagani if you are looking for html report with test results take a look at Extent Report, or Report Portal. Both tools are pretty easy to integrate to Atata.
    Hiren Barad
    @baradhiren

    Hello, Is there any way to get the number of rows which has the same value in kendo grid?
    Exa.:
    someKendoGrid.Rows[x => x.Name == 'Hiren']

    And get count of rows which have Hiren as value?

    Yevgeniy Shunevych
    @YevgeniyShunevych

    Hey @baradhiren.

    Here are samples:

    // Assume that page.Cars is KendoUIGrid.
    
    string expectedCarMake = "Nissan";
    
    // How to get count into a variable:
    int count = page.Cars.Rows.Count(car => car.CarMake == expectedCarMake);
    
    // How to perform count assertion:
    page.Cars.Rows.Should.Satisfy(x => x.Count(car => car.CarMake == expectedCarMake) == 2, $"contain 2 {expectedCarMake}");
    New Atata example: Custom FindByAttributeAttribute
    Hiren Barad
    @baradhiren
    Awesome. Thanks @YevgeniyShunevych
    Yevgeniy Shunevych
    @YevgeniyShunevych
    No problem.
    Hiren Barad
    @baradhiren
    Hey @YevgeniyShunevych, One more question. If I have a hidden column in my kendogrid is there any way I can get text value from that?
    Yevgeniy Shunevych
    @YevgeniyShunevych
    Hey @baradhiren. You can find this column for example by index like below. And there is a need to set ContentSource (because by default text of hidden elements is "").
    [FindByColumnIndex(2, Visibility = Visibility.Any)]
    [ContentSource(ContentSource.TextContent)]
    public Text<_> HiddenColumnText { get; private set; }
    Hiren Barad
    @baradhiren
    Thanks @YevgeniyShunevych I will try that out.
    Yevgeniy Shunevych
    @YevgeniyShunevych
    You're welcome.
    Yevgeniy Shunevych
    @YevgeniyShunevych
    Atata 1.6.0 is released with several new features