This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
1 / 16
Oct 2014

Hi, I am currently working as automation test analyst and the company i am working for has asked me to implement Mobile automation. I have heard that appium is nice and free source tool.

But i am struggling to find enough information online on how to setup on appium in windows 8 and writing test scripts in c# on android devices.

If anyone can give me step by step process of how to setup the appium on my machine and any sample code including framework and test scripts in c# is much APPRECIATED.

Thanks in Advance.

  • created

    Oct '14
  • last reply

    Mar '18
  • 15

    replies

  • 6.0k

    views

  • 6

    users

  • 4

    links

Hi Jonahss,

thanks for the link, that dosen't really help me. Am looking for a sample project that would help me to setup automation on windows using appium and writing automation scripts in c# and selenium webdriver

Hi Mitsram,

Thanks for the responding and it is quite useful. Is there any sample project to look at?

thanks in advance

I have managed to setup dotnet project and started writing a basic login test for a mobile the app i am testing.

When i viewed in UI Automator View the Username and Password field has same class name

I have managed to type the username but i am struggling to find the exact location of the password field to type the password using "sendkeys".

I have tried different methods like:
IWebElement element = driver.FindElementByXPath("");
element.Click();
element.SendKeys("password");
pswrd.SendKeys("password");

And
Dictionary coords = new Dictionary();
coords.Add("x", 35384);
coords.Add("y", 785429);
driver.ExecuteScript("mobile: tap", coords);

Nothings works for me.

Can any one help me please? Thanks

In my experience, finding element by class is not reliable. You should use resouce-id. But it seems your resource-id is blank. What's your Android version? Higher version should display resource-id. I have an example for finding by id.Try this:
WebDriver driver = null;
List"<"WebElement">" elements = driver.findElements(By.id(object id));
elements.get(0).sendKeys("username");
elements.get(1).sendKeys("password");

That code is in Java. You can easily convert that to C#.

HTH

can we click on using the co-ordinates that are available in UI Automator viewer?

many thanks

yes.

public void tapScreen(int xCoordinate, int yCoordinate) {
JavascriptExecutor js = (JavascriptExecutor) driver;
HashMap"<"String, Integer">" tapObject = new HashMap"<"String, Integer">"();
tapObject.put("x", xCoordinate);
tapObject.put("y", yCoordinate);
js.executeScript("mobile: tap", tapObject);
}

ignore the double quote "<" or ">" in the code. it will not display in the post without the double quotes

Thanks mitsram,

You are a star, it worked with your below script. ofcourse i have modified it into c#

List"<"WebElement">" elements = driver.findElements(By.id(object id));
elements.get(0).sendKeys("username");
elements.get(1).sendKeys("password");

That code is in Java. You can easily convert that to C#.

1 year later

HI Kumar_v. Can you send me total details of how to use appium in C#(With installation details).I also want to use this for android application automation in C#.
Anybody else Please help me in this ....i want to generation android automation test script using only c#

Please send me tutorial for this in my mail id : manjitsinh.chavda@promptsoftech.com.Thanks in advance if anybody can help me.

2 years later