How to locate an Element in Appium Python | Appium Locator strategies

Поделиться
HTML-код
  • Опубликовано: 4 фев 2025

Комментарии • 45

  • @kutsokon
    @kutsokon 2 года назад

    Thanks you helped me a lot :) i was dealing with about 7 different phones simulator 3 days in a row, but now i exactly found it

  • @viacheslavgurov4371
    @viacheslavgurov4371 Год назад

    Namaste. It is what I expected. I'm in need to clarify. Timecodes will make your session better.

  • @abgouri9813
    @abgouri9813 4 года назад +3

    Hey, the explanations are very clear like a blue sky. Liked it.
    Could you help understand how to deal with duplicate elements without using XPATH / dynamic xpath..
    May be using uiselector...

  • @sarthakmahapatra9002
    @sarthakmahapatra9002 8 месяцев назад

    You are awesome

  • @WaldoTheWombat
    @WaldoTheWombat 4 года назад +1

    great video, what about image locators?

  • @abiprakash21m
    @abiprakash21m 10 месяцев назад

    what the difference between using ID and Xpath elements?

  • @hukkemaaruspetus787
    @hukkemaaruspetus787 5 лет назад +2

    how to click on radio buttons. tried x path and id but it is not working.

  • @arun53413
    @arun53413 5 лет назад

    Thank you so much, this is very helpful. You are also covering additional tips on pycharm shortcuts and methods, really helpful.
    But I've a problem :
    1. I installed Android Studio but in cmd -> 'android' command is not working.
    Getting something like below:
    C:\Users\Admin>android
    **************************************************************************
    The "android" command is deprecated.
    For manual SDK, AVD, and project management, please use Android Studio.
    For command-line tools, use tools\bin\sdkmanager.bat
    and tools\bin\avdmanager.bat
    **************************************************************************
    Invalid or unsupported command ""
    Supported commands are:
    android list target
    android list avd
    android list device
    android create avd
    android move avd
    android delete avd
    android list sdk
    android update sdk
    So I think, because of this in Appium am not able to invoke the app successfully, getting error like below:
    An unknown server-side error occurred while processing
    the command. Original error: Could not find 'adb.exe' in
    PATH. Please set the ANDROID_HOME or
    ANDROID_SDK_ROOT environment variables to the corect
    Android SDK root directory path.
    But all my path variables are set.
    Please , any one help me and unblock me from this.

  • @creatur
    @creatur 3 года назад

    Can we make a application to do all this automation (like open calc and do things). I mean cam we make a apk by all of this program files.

  • @danithomas_
    @danithomas_ Год назад

    how to handle the toggle button??

  • @sachinjoshi5211
    @sachinjoshi5211 4 года назад +3

    Nice Videos , I have noticed that the send_keys method doesnt work with certain type of elements , The error is selenium.common.exceptions.InvalidElementStateException: Message: Cannot set the element to 'sachin joshi'. Did you interact with the correct element? I see that many people have reported the same issue but i dont see any real solution , Any response will be helpful . Thank you in Advance :)

    • @geetumodi691
      @geetumodi691 2 года назад

      Hi, I tried so much to complete the Appium set-up, but nothing's working. Can you help me with that

  • @shrishailh278
    @shrishailh278 4 года назад

    How exactly we can navigate directly to user settings page in Facebook instead of clicking on menu then user settings? Like driver. Get functionality in selenium

  • @NiteshSharma-qt5gi
    @NiteshSharma-qt5gi 5 лет назад

    Hi Cope,
    One quick question, This app installs in my phone after running this script but after installing the app it doesn't do anything no click nothing.. and when i check in pycharm it says code executed (0) seems like it stops after installing the app.. any suggestions?

  • @ks653
    @ks653 5 лет назад

    Hey Cope, 2 doubts :
    1. Using ID over Xpath and Class is preferable ?
    2. I tried the same scripts, but after clicking not null, my script goes to Search bar again and types LL

  • @Mr767267
    @Mr767267 2 года назад

    I think you skipped on find_by_accessibility_id, that would be really helpful to keep the automation code between IOS and Android same.

  • @developers_hub
    @developers_hub 2 года назад

    can't we run any native app like chrome

  • @sourabhahuja2382
    @sourabhahuja2382 4 года назад

    Hi, Can we can run some website test on android browser like chrome, firefox etc.

    • @TomThomasVempala
      @TomThomasVempala 4 года назад +2

      yeah you can
      this is my code:
      from appium import webdriver
      desiredCap={
      "deviceName": "emulator-5554",
      "platformName": "Android",
      "appPackage": "com.android.chrome",
      "appActivity": "com.google.android.apps.chrome.Main",
      "noReset": True,
      "automationName": "UiAutomator2"
      }
      driver=webdriver.Remote("localhost:4723/wd/hub",desiredCap)
      driver.implicitly_wait(30)
      searchbar=driver.find_element_by_id("com.android.chrome:id/search_box_text")
      searchbar.send_keys("Batman")
      driver.keyevent(84)

    • @creatur
      @creatur 3 года назад

      Can we make a application to do all this automation (like open calc and do things). I mean cam we make a apk by all of this program files.

  • @vikramvikki4265
    @vikramvikki4265 2 года назад

    What about image locators?

  • @RajeevKumar-cf4er
    @RajeevKumar-cf4er 5 лет назад

    Can Appium also open any app in physical mobile also without touching the mobile.

    • @filipgajic93
      @filipgajic93 4 года назад

      It can, you can set it like this:
      First, you need to start appium, you can do it from the GUI or from CMD simply by typing "appium"
      Make sure your device is connected with PC and enable USB debugging and file transfer.
      "appPackage" and "appActivity" -> you can find with:
      Apk Info application: play.google.com/store/apps/details?id=com.wt.apkinfo&hl=en
      Create a new .py file and input following, for example:
      from appium import webdriver
      desired_cap = {
      "deviceName": "HUAWEI Mate 20 Pro",
      "platformName": "Android",
      "PlatformVersion": "10",
      "appPackage": "app package name-> copy from Apk Info app",
      "appActivity": "app activity name-> copy from Apk Info app"
      }
      driver = webdriver.Remote("localhost:4723/wd/hub", desired_cap)
      PS: localhost can vary, mine is 4723 buy yours can be different, just change the number

  • @sanyal27
    @sanyal27 4 года назад

    Can you please tell how to find element using parent child hierarchy [other than xpath]

    • @CopeAutomation
      @CopeAutomation  4 года назад +1

      Hi,
      Unlike Selenium's CSS selectors, there are only limited options for Appium and again the strategy varies based on the device. For Android, please explore this option to see if you can use any of these: developer.android.com/reference/android/support/test/uiautomator/UiSelector

    • @sanyal27
      @sanyal27 4 года назад

      @@CopeAutomation I am trying to learn appium using python .
      Could u please suggest me a good place to learn?

  • @darwintech5920
    @darwintech5920 3 года назад

    how to fix this plss appium.webdriver' has no attribute 'Remote' (most likely due to a circular import

  • @surajkumar-to5zh
    @surajkumar-to5zh 5 лет назад

    hi bro, appium is very slow in finding the element and entering the text...Do u have any solution for this

    • @CopeAutomation
      @CopeAutomation  5 лет назад +1

      Hi,
      The slowness could be due to various reasons application rendering, internal API calls turn around time and so on. There isn't any direct way to fix it until otherwise you introduced any delays

    • @surajkumar-to5zh
      @surajkumar-to5zh 5 лет назад

      @@CopeAutomation thank you for the reply

    • @surajkumar-to5zh
      @surajkumar-to5zh 5 лет назад

      @@CopeAutomation can u make a video on parallel testing using appium and python.... I need it for my reference... Can you make it please.

  • @Diepali
    @Diepali 4 года назад

    How to handle
    Error: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec
    please guide sir

    • @vanitawashington2183
      @vanitawashington2183 4 года назад

      The same thing is happening to me. When I tried to use Appium with ApowerMirror, the device is disconnected from the computer (there are no adb devices for Android). I switched to another Apower product called LetsView and Appium worked.

  • @WaldoTheWombat
    @WaldoTheWombat 4 года назад

    when i click on AirMirror on the Emulator it immediately crashes

  • @WaldoTheWombat
    @WaldoTheWombat 4 года назад

    You can add this do your Json (your dictionary) to allow all permissions and to keep Appium from resetting the app when it runs it each run.
    "autoGrantPermissions": True,
    "noReset": True

  • @ishan1701
    @ishan1701 4 года назад

    I am trying to perform the same with an app. The app is getting opened on the emulator but not proceeing further.
    selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.**myApp**'' application. Visit github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: '*.SplashActivity' or 'com.**myApp**.*.SplashActivity' never started. Visit github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting

  • @The_Night707
    @The_Night707 4 года назад

    Hello, can I contact you via Facebook or by mail?