Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Musa Balta
    @musabalta
    Hi @YevgeniyShunevych thank you for this framework. I have a problem with angular material select element. This element name <mat-select>, and I can't find this element. How can I find? Thank you
    Musa Balta
    @musabalta

    Hi again, I fixed the problem. I used Control<_> element for <mat-select> . Also, this element is hidden, and I set it visible.

    [FindByXPath("mat-select[@id='xxx']", Visibility = Visibility.Visible)]
    public Control<_> MatSelectExample { get; private set; }

    Yevgeniy Shunevych
    @YevgeniyShunevych
    Hi @musabalta. You may also take a look at AngularJS Material Select for Atata gist. Implementation for Angular Material Select can be similar.
    Yevgeniy Shunevych
    @YevgeniyShunevych
    Hey @mdilovar, unfortunately there is no built-in method in Atata currently to take component screenshots, only full-page. But it can be implemented cusomly using the way like here: https://stackoverflow.com/a/13834607/8063294
    Musa Balta
    @musabalta
    @YevgeniyShunevych thank you.
    Yevgeniy Shunevych
    @YevgeniyShunevych
    Hey @samgrimmer. Regarding Angular JS radio button group control. First of all, inheriting from RadioButtonList isn't a good idea. It is better to inherit OptionList the way RadioButtonList does, but with Material specifics. Or inherit EditableField, which is always OK.
    Jerome Haltom
    @wasabii
    Hey. I have an interesting project, to test a rich non web app. I was think about Appium, which provides a Web driver implementation for non HTML stuff. Has an Atata user tried something like this?
    Musa Balta
    @musabalta
    Hi, @YevgeniyShunevych , I want to use DragAndDropTo function with the SVG element. The moving process is working very well but the drop process is not working. Actually, I guess, the process is not finding the correct element in the SVG. How can I describe correct element for SVG? The result here => https://imgur.com/a/dLv9tvl
    Also, I am using FindByClass attr for the RECT element. You can see here => https://imgur.com/B5fR2tz
    Thank you.
    Yevgeniy Shunevych
    @YevgeniyShunevych

    Hey @musabalta. <svg> element and it's children requires specific XPath in WebDriver element finding operation. For example, using XPath "//svg" will not find <svg> element, instead you should use //*[name()='svg'].

    Here is an example of page object that works with <svg>:

    namespace Atata.Tests
    {
        using _ = SvgPage;
    
        [Url("svg")]
        public class SvgPage : Page<_>
        {
            public SvgControl Svg { get; private set; }
    
            [ControlDefinition("*[name()='svg']", ComponentTypeName = "SVG")]
            public class SvgControl : Control<_>
            {
                [FindByClass("draggable")]
                [ControlDefinition("*[name()='rect']")]
                public Control<_> Rectangle { get; private set; }
    
                [FindByClass("draggable")]
                [ControlDefinition("*[name()='polygon']")]
                public Control<_> Polygon { get; private set; }
            }
        }
    }

    And here is a sample of dragging and dropping <rect> element to polygon>:

    Go.To<SvgPage>().
        Svg.Rectangle.DragAndDropTo(x => x.Svg.Polygon);
    Musa Balta
    @musabalta

    Hi again @YevgeniyShunevych

    I tried this SVG XPath but still isn't working.

    For example: this code of selenium is not working:
    Action.dragAndDrop(source, target).build().perform();

    Also, the another action for drag and drop is not working too:
    Action.ClickAndHold(source); Action.MoveToElement(target); Action.Build(); Action.Perform();

    If I change the code like below, it is working very well.
    Action.ClickAndHold(source); Action.MoveToElement(target); Action.Perform(); Action.Release(target); Action.Perform();

    Also, If I remove the last line (Actions.perform code line) code, it is not working. Thank you.

    Hiren Barad
    @baradhiren
    Hello Everyone, I am bit new to atata but I am trying to automate a login page workflow. But whenever I click on next it errors out giving stalereference error

    This is the code that I used to navigate to password page:

    public Button<PasswordPage, _> Next { get; private set; }

    byakoshiki
    @byakoshiki_twitter
    @baradhiren as far as i know you can add 2 Atrribute Bindings like [VerifyExist = BeforeAnyAction] and to add Wait(unitl.VisibleOrHidden) with timeout
    Hiren Barad
    @baradhiren
    Thanks. I'll try that out
    Hiren Barad
    @baradhiren
    @byakoshiki_twitter The wait condition worked. Thanks.
    byakoshiki
    @byakoshiki_twitter
    @baradhiren no problem. You are welcome
    Hiren Barad
    @baradhiren
    Hello Everyone, Any idea on how can I validate the color of any UI element using atata?
    byakoshiki
    @byakoshiki_twitter
    @baradhiren i am not sure but there should be get method for CSS attributes
    so you can get an attribute and assert it with fluent assersionts
    Hiren Barad
    @baradhiren
    Ahh, thanks again @byakoshiki_twitter . I will try it out and let you know. :)
    Hiren Barad
    @baradhiren
    Hey guys any idea what type of element svg will come under?
    byakoshiki
    @byakoshiki_twitter
    svg?
    Yevgeniy Shunevych
    @YevgeniyShunevych
    Hey @baradhiren. Regarding color assertion. You can do it this way:
    control.Css["color"].Should.Equal("...")

    Regarding SVG. There are several classes implemented for SVG. But they are not released yet. They will appear in upcoming Atata v1.5.0.

    You can find SVG controls here: https://github.com/atata-framework/atata/tree/master/src/Atata/Components/Svg
    Here is the example of test page object that contains SVG: https://github.com/atata-framework/atata/blob/master/src/Atata.Tests/Components/SvgPage.cs

    Hiren Barad
    @baradhiren
    @YevgeniyShunevych thanks. I'll check that out.
    Yevgeniy Shunevych
    @YevgeniyShunevych
    Welcome.
    Hiren Barad
    @baradhiren

    Another question on Kendo Datepicker. I am trying to set the value but getting an error like this:
    OpenQA.Selenium.InvalidElementStateException : Element is read-only: <input id="StartDate" class="k-input" type="text">
    Is there any other way to set the value for datepicker or to resolve this issue?

    Note: I am able to set the value from calendar box. Which gets displayed to user once I click on the calendar icon.

    byakoshiki
    @byakoshiki_twitter
    @baradhiren but error literaly states that the field you try to access is in read-only state, means it is not enabled so Atata or not will not be able to sendKeys or anthing
    better make sure that field is not in read-only state
    Yevgeniy Shunevych
    @YevgeniyShunevych
    I assume that your date picker UI component is only editable thru calendar icon, but not input. Unfortunately Atata KendoDatePicker doesn't work thru calendar. You can inherit from KendoDatePicker and override there just SetValue method to work thru calendar.
    Hiren Barad
    @baradhiren
    Ahhh ok. Thanks.
    Hiren Barad
    @baradhiren
    So, I have tried inheriting from KendoDatePicker to select the date through calendar. But I am not able to define the calendar icon as an element for my custom datepicker. I am not sure what type of element I should go for. It is a span tag with role='button'. Any idea on how can I add calendarButton as an element for this like we have done with Associatedinput in the current KendoDatePicker?
    Yevgeniy Shunevych
    @YevgeniyShunevych
    For all untypical controls you can use Control class. So you can define the propery this way:
    [FindByAttribute("role", "button")]
    public Control<TOwner> CalendarIcon { get; private set; }
    Hiren Barad
    @baradhiren
    Can I club more settings with this? Let's say if I also want to mention the xpath to the icon if I have multiple calendarIcons on the same page?
    Hiren Barad
    @baradhiren
    @YevgeniyShunevych This worked. Thanks.
    Hiren Barad
    @baradhiren
    Hey, Any Idea on how should I find any elements which I am finding at run time(Based on an id which gets generated dynamically)? Also if I want to introduce any waits inside methods before these elements become clickable?
    Hiren Barad
    @baradhiren
    To give more information on this. I am getting OpenQA.Selenium.ElementClickInterceptedException : Element <a class="k-link" href="#"> is not clickable at point (617,160) because another element <a class="k-link" href="#"> obscures it When I execute my test cases for now. I have googled and it suggests me to execute the click via script. Is that a good idea?
    Yevgeniy Shunevych
    @YevgeniyShunevych

    Hey. Regarding finding controls at runtime. Take a look at these gists: https://gist.github.com/YevgeniyShunevych/a1bbfd9cf42b39abb6cae9158b2fdc61, https://gist.github.com/YevgeniyShunevych/ecb66d0a872eb3325ab32b718094f0a1

    In addition to find attributes you can also add any triggers there.

    Yevgeniy Shunevych
    @YevgeniyShunevych
    Regarding ElementClickInterceptedException. I would better figure out why some other link tries to recieve a click instead of the target one. If you are clicking dates in calendar, it probably can happen because of calendar animation. I can see that it slightly appear from top to bottom. So when you found a day link and then do the click, this actual element can move down already during this short interval. But it is just guessing. You can add some waits to make actions slower and ensure that the issue is in animation.
    Hiren Barad
    @baradhiren
    @YevgeniyShunevych Thanks for the reply. May I know what will be a good way to add a wait in between of these clicks?
    Yevgeniy Shunevych
    @YevgeniyShunevych
    For example, to wait 2 seconds, you can use one of the ways:
    • Add [Wait(2, TriggerEvents.BeforeClick)] trigger to the link which you click.
    • Before clicking link, using page object: pageObject.Wait(2).SomeLink.Click().
    Hiren Barad
    @baradhiren
    Awesome. Thank you very much. I will try that out.
    Yevgeniy Shunevych
    @YevgeniyShunevych
    Sure, welcome.
    Hiren Barad
    @baradhiren
    I tried creating the elements as suggested in your gists. But getting this error : OpenQA.Selenium.NoSuchElementException: 'Unable to locate visible element:
    Valuamba
    @Valuamba
    image.png
    image.png
    image.png
    Valuamba
    @Valuamba
    @YevgeniyShunevych Hello, what i doing wrong? Why i'am getting NoSuchElementException: Unable to locate visible "Sites" unordered list's "x == "How It Works"" element. I'm doing as you showed in tutorial. I need to click on menu item, but i'm without understanding how to do it.
    Yevgeniy Shunevych
    @YevgeniyShunevych
    Hey @Valuamba. It's hard to say. I would debug a bit. For example, you can check what is the actulal text of "How it Works" menu item. Check Sites.Items[0].Value or just try Sites.Items[0].Should.Equal("How it Works") (if it doesn't equal, exception will contain actual text value).