Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Android
  4. c# Appium Android Search Key is not working

c# Appium Android Search Key is not working

Scheduled Pinned Locked Moved Android
csharpjavaandroidhelp
2 Posts 2 Posters 8 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    subinrajuu
    wrote on last edited by
    #1

    Hello , I am facing issues to do search from a search-box. There are a couple of solutions in Java, but couldn't find the right solution in c#. Please help. I have tried the following code. DdlStoreAddress.GetElement().Click(); TxtSearchShop.GetElement().Click(); TxtSearchShop.GetElement().SendKeys(stroreID); //TxtSearchShop.GetElement().Click(); //AppiumDriverContext.Driver.PressKeyCode(AndroidKeyCode.Keycode_SEARCH); //AppiumDriverContext.Driver.HideKeyboard(); //new Actions(AppiumDriverContext.Driver).KeyDown(OpenQA.Selenium.Keys.Enter).Perform(); //Thread.Sleep(TimeSpan.FromSeconds(1)); //new Actions(AppiumDriverContext.Driver).KeyUp(OpenQA.Selenium.Keys.Enter).Perform(); //AppiumDriverContext.Driver.Keyboard.PressKey(("{ENTER}"); //AppiumDriverContext.Driver.Keyboard.SendKeys(84); AppiumDriverContext.Driver.PressKeyCode(84); //System.Threading.Thread.Sleep(500); //AppiumDriverContext.Driver.HideKeyboard(); //BtnSearchShop.GetElement().Click(); Thread.Sleep(10000); //Thread.Sleep(2000); //AppiumDriverContext.Driver.PressKeyCode(AndroidKeyCode.Keycode_SEARCH); //Thread.Sleep(2000); //AppiumDriverContext.Driver.PressKeyCode(AndroidKeyCode.KeycodeNumpad_ENTER); //Thread.Sleep(5000); //driver.ExecuteScript("mobile:scroll", new Dictionary { { "direction", "down" } }); //BtnSearchShop.GetElement().Click(); //TxtSearchShop.GetElement().SendKeys(AndroidKeyCode.Enter); //AppiumDriverContext.Driver.LongPressKeyCode(66); //AppiumDriverContext.Driver.HideKeyboard(); The following is my capabilities. caps.AddAdditionalCapability("browserstack.user", MobileBaseConfiguration.BrowserStackUser); caps.AddAdditionalCapability("browserstack.key", MobileBaseConfiguration.BrowserStackKey); caps.AddAdditionalCapability("app", MobileBaseConfiguration.AppUrl); caps.AddAdditionalCapability("device", MobileBaseConfiguration.Device); caps.AddAdditionalCapability("os_version", MobileBaseConfiguration.OSVersion); caps.PlatformName = MobileBaseConfiguration.PlatformName.ToString(); caps.AddAdditionalCapability("project", MobileBaseConfiguration.Project);

    Richard DeemingR 1 Reply Last reply
    0
    • S subinrajuu

      Hello , I am facing issues to do search from a search-box. There are a couple of solutions in Java, but couldn't find the right solution in c#. Please help. I have tried the following code. DdlStoreAddress.GetElement().Click(); TxtSearchShop.GetElement().Click(); TxtSearchShop.GetElement().SendKeys(stroreID); //TxtSearchShop.GetElement().Click(); //AppiumDriverContext.Driver.PressKeyCode(AndroidKeyCode.Keycode_SEARCH); //AppiumDriverContext.Driver.HideKeyboard(); //new Actions(AppiumDriverContext.Driver).KeyDown(OpenQA.Selenium.Keys.Enter).Perform(); //Thread.Sleep(TimeSpan.FromSeconds(1)); //new Actions(AppiumDriverContext.Driver).KeyUp(OpenQA.Selenium.Keys.Enter).Perform(); //AppiumDriverContext.Driver.Keyboard.PressKey(("{ENTER}"); //AppiumDriverContext.Driver.Keyboard.SendKeys(84); AppiumDriverContext.Driver.PressKeyCode(84); //System.Threading.Thread.Sleep(500); //AppiumDriverContext.Driver.HideKeyboard(); //BtnSearchShop.GetElement().Click(); Thread.Sleep(10000); //Thread.Sleep(2000); //AppiumDriverContext.Driver.PressKeyCode(AndroidKeyCode.Keycode_SEARCH); //Thread.Sleep(2000); //AppiumDriverContext.Driver.PressKeyCode(AndroidKeyCode.KeycodeNumpad_ENTER); //Thread.Sleep(5000); //driver.ExecuteScript("mobile:scroll", new Dictionary { { "direction", "down" } }); //BtnSearchShop.GetElement().Click(); //TxtSearchShop.GetElement().SendKeys(AndroidKeyCode.Enter); //AppiumDriverContext.Driver.LongPressKeyCode(66); //AppiumDriverContext.Driver.HideKeyboard(); The following is my capabilities. caps.AddAdditionalCapability("browserstack.user", MobileBaseConfiguration.BrowserStackUser); caps.AddAdditionalCapability("browserstack.key", MobileBaseConfiguration.BrowserStackKey); caps.AddAdditionalCapability("app", MobileBaseConfiguration.AppUrl); caps.AddAdditionalCapability("device", MobileBaseConfiguration.Device); caps.AddAdditionalCapability("os_version", MobileBaseConfiguration.OSVersion); caps.PlatformName = MobileBaseConfiguration.PlatformName.ToString(); caps.AddAdditionalCapability("project", MobileBaseConfiguration.Project);

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      You seem to have forgotten to ask a question; "not working" is nowhere near enough information for anyone to help you.


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups