Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    dhairyahetal
    @dhairyahetal
    Hi @YevgeniyShunevych , while running the tests on circleci, we are getting WebDriver Exception and Error message 'Cannot start the driver service'
    TamasSzalisznyi
    @TamasSzalisznyi
    Hi @YevgeniyShunevych ! Is it possible to customize 'FindByColumnHeader' to use attribute?
    13 replies
    dhairyahetal
    @dhairyahetal
    Hi @YevgeniyShunevych , for declaring a dropdown field, and selecting a value from it using enums (from the tests), could you please share some utilites?
    dhairyahetal
    @dhairyahetal
    I have something like this
    public enum Gender
    {
    Male,
    Female
    }
    and I want to be able to use public Gender<Gender, _> {get, set}
    Gender.Set(Gender.Male)
    Yevgeniy Shunevych
    @YevgeniyShunevych
    Hi @dhairyahetal. If your dropdown is <select> you can use Select component.
    heta6
    @heta6:matrix.org
    [m]
    Hi @YevgeniyShunevych , could you please share pointers to add a docker image to run the automated tests on Chrome driver remotely
    the CircleCi script is able to find the Atata tests all good, however it is not able to launch these on chrome driver when run from the Circle platform remotely?
    heta6
    @heta6:matrix.org
    [m]
    version: 2.1
    docker:
      - image: mcr.microsoft.com/dotnet/core/sdk:3.1
    steps:
      - checkout
      - run:
          working_directory: ~/project
          name: Run tests
          command: |
    
            cd test
            cd AtataSampleApp.UITests
            dotnet test
    jobs:
      - build-and-test
    Please find the script here
    heta6
    @heta6:matrix.org
    [m]
    Atata tests worked on CircleCi after adding arguments for driver in json file @YevgeniyShunevych
    dhairyahetal
    @dhairyahetal
    Hello, can we create a shell script to replace variable value in Atata. json file from Circleci environment variables for security purposes?
    Yevgeniy Shunevych
    @YevgeniyShunevych
    1 reply
    dhairyahetal
    @dhairyahetal
    image.png

    Hi @YevgeniyShunevych , I'm using Atata.Bootstrap to select a value from this dropdown field
    [FindByXPath("//button[@name='LoanPurpose_c']")]
    public Atata.Select<LoanPurpose?,
    > LoanPurpose { get; private set; }

    However the tests are not able to find this element and set the value

    2022-01-25 10:02:09.1952 ERROR OpenQA.Selenium.NoSuchElementException : Unable to locate visible element:
    • By: XPath "(//button[@name='LoanPurpose__c'])/descendant-or-self::select"
    • Search time: 5.019s
    • Search options: {Visibility=Visible, Timeout=5s, RetryInterval=0.5s, IsSafely=False}
    I'm using this approach to set the value in dropdown, LoanPurpose.Set(LoanPurpose.Refinance)
    Yevgeniy Shunevych
    @YevgeniyShunevych
    Hi @dhairyahetal. Your property definition is incorrect. It tries to find <select> in a <button> element. Could you drop a piece of HTML of that dropdown field to understand its markdown?
    dhairyahetal
    @dhairyahetal
    image.png
    Yevgeniy Shunevych
    @YevgeniyShunevych
    I got it. It is a Salesforce lightning dropdown. Select will not work here. You need a custom control for it.
    dhairyahetal
    @dhairyahetal
    Got it, thanks @YevgeniyShunevych
    dhairyahetal
    @dhairyahetal
    image.png
    Here is the entire div snippet for reference
    Yevgeniy Shunevych
    @YevgeniyShunevych
    Might be useful for someone else who need to create a control for custom HTML dropdown. I implemented a custom control for Salesforce Lightning combobox in Atata Samples / Salesforce Lightning Components that does its job.
    1 reply
    dhairyahetal
    @dhairyahetal
    Hi @YevgeniyShunevych , I'm running into System.ArgumentException : Failed to find mapped control by specified 'controlDelegate'.
    4 replies
    Steven Pham
    @tienminh271
    Hi @YevgeniyShunevych just a quick question.
    I have a page that has query path in URL, so in the page object of this page, it will need 2 constructors: one is used for Go.To(SamplePage(queryPath)), and another one without any paremetters is used for On<SamplePage>().PageMethod(). Is it right?
    SamplePage(string queryPath)
    {
       // Initialization
    }
    
    SamplePage()
    {
    
    }
    4 replies
    dhairyahetal
    @dhairyahetal
    image.png
    Here is the log of the error- the issue is when i move to another element which is a button next after setting the dropdown field just appearing before it, this happens I'm running into System.ArgumentException : Failed to find mapped control by specified 'controlDelegate'.
    When I dont click the button and just set the value on the dropdown field i dont see any errors
    Yevgeniy Shunevych
    @YevgeniyShunevych
    Can you share your page object button C# code?
    dhairyahetal
    @dhairyahetal
        [FindByName("FieldName")]
        public SLCombobox<Fieldname,_> Fieldname{ get; private set; }
    5 replies
    Steven Pham
    @tienminh271

    Hi @YevgeniyShunevych, I have fields to input value in decimal type. In Atata which Control Type is best suited for it? I only found TextInput and NumberInput are relevant, but NumberInput only works with int type

    image.png

    3 replies
    dhairyahetal
    @dhairyahetal
    Hi @YevgeniyShunevych , could you please explain using Atata.local.json versus Atata.json as expected could help running files locally and how internally framework decides which json file it should use based on local versus cicd runs?
    7 replies
    dhairyahetal
    @dhairyahetal
    Could you please suggest best way to select the button highlighted in this snapshot
    image.png
    I'm using this approach //c-opportunity-header//div//li//button[contains(text(),'Edit')]) but this fails to select the Edit button in headless mode :-(
    Yevgeniy Shunevych
    @YevgeniyShunevych
    Basically, even simple [FindByContent("Edit")] should work here. Is the problem really in headless mode? Can you share the error message?
    1 reply
    Steven Pham
    @tienminh271

    Hi @YevgeniyShunevych , I face with a special DateInput component that does not allow to type-in, [SetValueUsingScript] also doesn't work. It's set value script is as

    $("#SpecialDateInput.datepicker").datepicker("setDate", new Date('2/21/2022'))

    I'm looking for way to create a [SetDateUsingScript] attribute for DateInput<>, but duno how to add my method into UIComponentScriptExecutor<TOwner>

    Steven Pham
    @tienminh271
    Btw, the script needs selector to identify element. Is there any way to get the selector from [FindBy...] attribute please?
    Yevgeniy Shunevych
    @YevgeniyShunevych

    Hi @tienminh271. You can try to create your own behavior attribute, like below, and apply it to component:

    public class SetsDatePickerValueUsingScriptAttribute : ValueSetBehaviorAttribute
    {
        public override void Execute<TOwner>(IUIComponent<TOwner> component, string value)
        {
            component.Script.ExecuteAgainst("$(arguments[0]).datepicker('setDate', new Date(arguments[1]))", value);
        }
    }

    In the script arguments[0] is a scope element of the component.

    Steven Pham
    @tienminh271
    Hi @YevgeniyShunevych, thank you for feeding back. Btw I'm wonder is there any field returns the locator I had defined for the component from [FindBy....] attribute?
    I'm trying with this code first. The method can except the Xpath but at least it can get the Css Selector. I'm finding way to get the Css Selector (not Css properties) and set it to arguments[0].
    private string ConvertToCssSelectorString()
            {
                var cssSelectorString = string.Empty;
    
                var declaration = this.Metadata.DeclaredAttributes.OfType<FindAttribute>().FirstOrDefault();
    
                if (declaration.GetType() == typeof(FindByIdAttribute))
                {
                    return $"#{Attributes.Id.Value}";
                }
                else if (declaration.GetType() == typeof(FindByClassAttribute))
                {
                    return $".{Attributes.Class.Value}";
                }
                else if (declaration.GetType() == typeof(FindByNameAttribute))
                {
                    return $"[name='{Attributes.Name.Value}']";
                }
                else if (declaration.GetType() == typeof(FindByTitleAttribute))
                {
                    return $"[title='{Attributes.Title.Value}']";
                }
                return cssSelectorString;
            }
    Yevgeniy Shunevych
    @YevgeniyShunevych
    It is difficult to extract a concrete selector from component, as it can be a chain of selectors. It depends. But I think you don't need it. jQuery selector in addition to CSS selector takes HTML element too. Have you tried to use that behavior above? Script having "$(arguments[0])", where arguments[0] is an element, is absolutely valid. So you don't need selector, just use component's scope element.
    Steven Pham
    @tienminh271

    It works. At first I didn't get you at the point

    In the script arguments[0] is a scope element of the component.

    so the argument[x] in the script represents exact input parameters of the Execute method in exact order, where the first parameter is UIUComponent<TOwner> component = argument[0]. Thanks so much for your patient.

    Yevgeniy Shunevych
    @YevgeniyShunevych
    Right. You are welcome.
    Steven Pham
    @tienminh271
    Hi @YevgeniyShunevych, do we have a wait attribute that can wait for Js Alert present? I'm going to create custom wait for it bases on the basic code like people who work directly with selenium. As I have a page object class represents for Js Alert, but not so sure which attribute should I inherit: WaitAttribute or WaitUntilAttribute.
    var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(15));
    wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.AlertIsPresent());
    2 replies
    dhairyahetal
    @dhairyahetal
    image.png
    Hi @YevgeniyShunevych , whenever selenium atata tests are run from the pipeline, the first test fails with Web Driver Exception: Chrome not reachable error
    Steven Pham
    @tienminh271
    Hi @YevgeniyShunevych , is there anyway to wait for table loaded completely via event 'draw.dt' ?
    sergimola
    @sergimola
    Is it possible to use WinAppDriver with Atata? I have been using Atata with Web projects and it would be really nice to use it for a new project I am starting for a WPF app tested with Appium + WinAppDriver.
    3 replies
    Yevgeniy Shunevych
    @YevgeniyShunevych
    Atata 2.0.0 is released with upgrade to Selenium WebDriver 4 and other useful improvements