1

I have a problem with testing of aúúlivation. I have this code for net CORE using MS test net.CORE. public class IPTV

{
    static WindowsDriver<WindowsElement> Sessions;


    [ClassInitialize]

    public static void BeforeTest(TestContext testContext)
    {
        AppiumOptions appiumOptions = new AppiumOptions();

        appiumOptions.AddAdditionalCapability("app", @"C:\Users\renata.cikova\Desktop\IPTVManagement\Colosseo.IPTVManagement.exe");
        //appiumOptions.AddAdditionalCapability("platformName", "Windows");
        // appiumOptions.AddAdditionalCapability("deviceName", "cikova-pc");
        Sessions = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723/"), appiumOptions);
        Sessions.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(25);
        // Session.Manage().Window().Maximize();



    }

    
    [TestMethod]
    public void UnsucessLogin()
    {
        if (Sessions.CurrentWindowHandle != Sessions.WindowHandles.Last())
        {
            Sessions.SwitchTo().Window(Sessions.WindowHandles.Last());
        }
        Sessions.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(50);
                   
        var textbox = Sessions.FindElementByClassName("RadBusyIndicator").FindElementByClassName("TextBox");
        textbox.SendKeys("Admin");
        Thread.Sleep(10);
        var password = Sessions.FindElementByClassName("PasswordBox");
        password.SendKeys("Admin");
        Thread.Sleep(10);
        Sessions.FindElementByName("Login").Click();
        System.Threading.Thread.Sleep(10);
        //var text = Session.FindElementByName("Unknown error").Text;
        //Console.WriteLine(text);
      //  Assert.AreEqual(text, "Unknown error");
        

    }

Appium open application, but can't find any elements of the application. What I have wrong? I haved installed web driver client, I am using UI recorder to identify the elements, so I definitely don`t know where is a mistake.

1

var textbox = Sessions.FindElementByClassName("RadBusyIndicator").FindElementByClassName("TextBox");

It looks like you are not using FindElement correctly.

Class name - For IOS it is the full name of the XCUI element and begins with XCUIElementType. For Android it is the full name of the UIAutomator2 class (e.g.: android.widget.TextView)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.