Showing posts with label Selenium 3. Show all posts
Showing posts with label Selenium 3. Show all posts

findElements method is different than the findElement method in selenium webdriver. findElements method is useful to find all elements from page using given element locator strategies.You can locate all specific elements from page using class name, css selector, id, name, link text, partial link text, tag name or xpath. findElements will return list of web elements using given locator strategy and then you can iterate through list and perform action. Lets see how it works.

We are using getTitle() method very frequently in out selenium webdriver tests. It is one of the basic and most commonly used method. getTitle() method is used to get the title of currently loaded web page. Also it will strip leading and trailing white space from title if available. Also it can return null if title of the page is not present.

Selenium WebDriver have many different methods and one of them is getCurrentUrl() method. So what is the actual usage of getCurrentUrl() method and when to use it. Well, any one can get a clue about usage of getCurrentUrl() method from its name. It will simply return current URL of browser after loading the page.

WebDriver interface has many different methods and get method is one of them. WebDriver interface is implemented by different browser classes like ChromeDriver, EdgeDriver, EventFiringWebDriver, FirefoxDriver, InternetExplorerDriver, OperaDriver, RemoteWebDriver and SafariDriver. So you can use get method to open any of these browser with given URL syntax.

get Method
  • Method Name : get
  • Method description : Using HTTP GET operation, It will load new web page in current web browser window. It will block all other operations until the browser load is completed. That means, Next syntax will be executed only after browser loaded completely with given URL.
  • Syntax : driver.get(String arg0)
  • Example : driver.get("");

36. What is command to start appium from command prompt?
Answer : "node appium" command from node_modules folder of appium will start appium server from command prompt. View start appium from command prompt example.

37. Is it possible to start and stop appium server programmatically?
Answer : Yes we can start appium server programmatically too. I have described two different methods on how to start and stop appium server programmatically. You can describe any one from them. View Method 1 and Method 2.

31. : Which method is used to perform scroll down to text in appium.
Answer : You can use scrollTo() method to scroll till text. View scroll down to text example.

32. : Is it possible to perform multi-touch action in appium test?
Answer : Yes, We can perform multi-touch action action in appium automation test using MultiTouchAction and TouchAction class. We can create touch action chain using MultiTouchAction and TouchAction class. View appium multi-touch action example.

26. : Can you tell me usage of findElements() method?
Answer : We can use findElements() method to get the list of elements from page.
Example : Supposing there are 5 buttons on page with same class name. In this case, We can use findElements() method and provide reference of class name in xpath(Example : findElements(By.xpath("//android.widget.Button"))). So it will return list of all button elements. Then we can use get() method and provide reference of button's index to locate specific button(Example : findElements(By.xpath("//android.widget.Button")).get(0)). View findElements() Example.

21. : Which android version is supported by appium?
Answer : Appium support Android 17+ API level versions only. You need to use selendroid if you have older version of android API level. View MORE DETAILS.

22. : How to configure appium project in eclipse?
Answer : Appium project configuration steps are given on THIS PAGE.

16. : Can you tell me few appium limitations?
Answer : Limitations Of Appium are described on THIS PAGE.

17. : Tell me different ways to locate android app elements in appium automation.
Answer : You can locate android app's elements using bellow given different ways.
  1. XPath
  2. ID
  3. Name
  4. className
  5. AccessibilityId
18. : Can you tell me different ways to locate element by XPath?
Answer : You can create XPath in different ways to locate same element. Different XPath examples are given on THIS PAGE.

11. : How to configure android device to run software test using appium in devices?
Answer : In order to run software automation tests using appium in android device, You need to enable USB debugging in your android device. VIEW DETAILS on how to enable USB debugging in android device.

12. : Tell me the command name for windows to verify that android device is connected with PC.
Answer : You can run adb devices command in windows to make sure that device is connected properly with PC to run appium tests on it.

6. : What is Node.js?
Answer : It is cross-platform runtime environment which is used to develop server-side software web applications. It is open-source so you can use it without any cost.

7. : What is Desired Capabilities and how it is used in Appium software testing tool?
Answer : Desired Capabilities is bunch of keys and it's value. Using this set of keys and values we can tell to appium server that what kind of automation session we are going to create. Example : If you set platformName = Android then appium will understand that you wants to create automation session to run test on Android.

1. : What Is Appium?
Answer : Appium is an open source mobile application automation testing tool. Using appium, We can automate native applications, Mobile web applications and mobile hybrid applications on Android and IOS platforms. VIEW MORE DETAIL

2. : What are the prerequisites to install appium in windows?
Answer : You need to install few software before install and use appium in windows. Bellow given software are required to install appium in windows.

Automating star rating bar in appium android software test is very easy, There will be star rating bar in many android software applications. Generally star rating bar is used to rate products, services in eCommerce android software applications. Mostly you will see 3 star and 5 star rating bars in such android software applications. If you wants to automate star ratings in appium android test then it is little tricky but very easy and we can do it using TouchAction class. Let's see how can we automate 3 star and 5 star rating bars of android software application using appium with example.

Selecting radio button of android software app in appium automation test is same action as selecting check-box as described in my Earlier article. Only difference between check-box selection and radio button selection is you can select only one radio button at a time from given list of radio buttons but you can select all check-box from given list. So it is easy to select radio button of any android software app using appium automation test. Let's take simple example to understand how to select radio button of android app In appium software automation test.

Retrieving all values from drop down list of android app software in appium software automation test is little tricky task but not hard. You can view how to SELECT VALUE from drop down list's popup in appium test. We can use findElements() method of selenium webdriver to locate and get all values from drop down list.

Selecting item/value from drop down is needed in android software app as most of the apps contain drop down. Earlier we learnt how to select value from spinner in android appium software test which is opening in direct list in THIS POST. Now let's see another example of how to select value from drop down list which is opening in popup.

Hiding keyboard in android device is one of the common action. In your android mobile device, It will show you soft keyboard on screen automatically when you type text in text box of software app so it will hide some of the elements. Now supposing you wants to select value from drop down which is hidden behind android keyboard. For that, You need to hide android keyboard first so that you can see drop down and then you can select value from it. In android appium software automation test, It is very easy to hide android keyboard using hideKeyboard() method of AndroidDriver. Let's learn how to hide android keyboard in appium software automation test.

Check box is another common element of any native, hybrid or mobile software web applications. Selecting check box of android software app in appium test is very easy task and I hope, most of you already knows how to select android app's check box in appium automation test but i have to think about bottom level learner who don't know how to select android app's check box in appium automation software test. Let's take very simple example to learn how to select check box in appium. We can use click() method to select check box.

Text box is very common element of any android native software app or software web application. In android appium software automation test, If you wants to type text in text box of android app then you can use sendKeys(keysToSend) command of selenium WebElement interface. Let's look at example to learn how to type in text box of android app.

In android, There is one important element ON/OFF switch. It is very easy to ON/OFF switch in android automation test using appium but you should know how to do it. In this article, I am going to described you how to ON/OFF switch in appium android automation test using tap(int fingers, int duration) method of MobileElement class. Also you can use click() method to tap on button but here we will use tap method for your understanding.