Hot answers tagged

4

If you look at the Appium Dotnet Driver changelog (https://github.com/appium/appium-dotnet-driver/releases) you can see the 4.x version is nearly 2 years in beta. It contains a lot of breaking changes, around 2-3 years of them. What you are getting is normal with major version upgrades. The programming interface (API) changes in major version to handle new ...


3

The answer to this question is pretty simple, Selenium is used for Browser automation whereas Appium is used for Mobile app automation. Obviously, we can combine both of these frameworks too. So, it depends on your testing scenario, whether you are targetting mobile app or a web browser. If your target is testing a mobile app then you should go with Appium ...


3

Convert your project to Maven project and use the surefire plugin. Inside the plugin mention the testng.xml file as the test suite. Now you can run your scripts in any environment using below commands. mvn install - This will install all the dependencies mvn test - This will run your scripts <plugin> <groupId>org.apache.maven.plugins</...


3

In the test you use a property driver which has not been instantiated, because you create the driver into local a variable called Driver. See the case-difference? The class property driver has a default value of NULL and that is why you get a nullpointer exception when you try to use it. You cannot use objects that are NULL. This is a foundational Java ...


2

Straight forward Answer: As Appium is a cross-language tool for mobile automation & it's independent of product language developed. you can use any language listed below. Ruby Python Java JavaScript PHP C# I am not able to decide which language should I use with Appium to automate this app. But the answer to this question is not straight forward: ...


2

By default, as per the Mocha documentation on reporters, there is no Excel reporter. There are some CLI reporters (Spec, Dot, etc) and there are HTML and JSON reporters. A quick Google search shows there is an NPM package called Mocha-Insights-Reporter that can generate Excel files. Since Mocha is open-source and has documentation, your other option is to ...


2

When querying Android apps with Xpath there is no id attribute. There is a resource-id attribute instead. Appium is doing work behind the scenes to still provide By.id as a locator despite this. By.xpath("//*[contains(@resource-id, 'read_indicator')]"); If you don't use contains here, you'll need to put in the full resource-id, which is very long. Your ...


2

Solution:1 From your code “wait.until (ExpectedConditions.visibilityOfNestedElementsLocatedBy (lastMessage, By.xpath(query)))” The expectation of the method (visibilityOfNestedElementsLocatedBy) used for checking the child WebElement as a part of parent WebElement to be visible. Since Nested explicit wait does not work in Appium instead we can use the ...


2

When you use xpath that is to locate nested elements you have to start your query from .. Like String query = ".//*[contains(@resource-id, 'delivered_indicator')]"; https://selenium.dev/selenium/docs/api/java/org/openqa/selenium/support/ui/ExpectedConditions.html#presenceOfNestedElementLocatedBy-org.openqa.selenium.By-org.openqa.selenium.By-


1

Try something like this: WebElement outerElement = driver.findElement(By.xpath("OTER_ELEMENT_XPATH")); WebDriverWait waiter = new WebDriverWait(driver, 100); WebElement innerElement = waiter.until(ExpectedConditions.elementToBeClickable(outerElement.findElement(By.xpath("./INNER_ELEMENT_XPATH"))));


1

For Android: You can scroll till you don’t find element with given resource id. This can be achieved with UiAutomator2as automation engine. You need to use automation name as UiAutomator2 in desires capabilities. Add in desired capability UiAutomator2 if you are using appium as automation engine. capabilities.setCapability(MobileCapabilityType....


1

1. you are not passing any driver instance to the Dashboard DashboardPage 2. You are trying to access local variable 'driver' which is not initialized yet Solution: Add : public void launchapp() { driver = new Setup().initializeAppiumServer(); } Or pass the already initialized driver to the dashboard: in your dashboard class also or pass ...


1

You can implement your page object as polymorphic interfaces, so your tests will run the same commands, but the underlying code is dispatched in runtime to the specific behavior. interface LoginPage { fun login(); } class MobileLogin implements LoginPage { fun login() { ... } } class WebLogin implements LoginPage { fun login() { ... } } Then ...


1

I'm not sure exactly why, but I updated my version of Appium to the v1.15.1 and now things are working. I guess there was some incompatibility of versions somewhere. Anyway, things are working now, which is great!


1

Make your tests independent of each other. Jest has the concept of beforeEach and afterEach functions. Use these to start and quit your Appium session for each test. When the app opens for each test it will be in the same place, and you can work forward from there. It adds a little overhead to each test, but it will let you avoid major headaches trying ...


1

You can instantiate driver like as given below: public static AppiumDriver <MobileElement> driver; if (Platform_Name.equalsIgnoreCase("ios")) { driver=new IOSDriver<MobileElement>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); else { driver=new AndroidDriver<MobileElement>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); ...


1

I had some problems connecting Appium with iOS devices using Appuim Desktop. My solution was to change Appium Desktop to Appium Studio. Appium Studio makes is easier to work with Apple devices.


1

Yes, you need apple developer ID , to build and deploy your project using Xcode on your real iOS device.


1

Use a service like https://www.twilio.com/ to recieve the SMS by your code. They provide phonenumbers, API's, etc...


1

I suspect your problem lies with the errors: java.lang.SecurityException: You need the android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS permission to use the PackageManager.INSTALL_GRANT_RUNTIME_PERMISSIONS This is saying that the phone does not have permission to run your software. Because your code is setting the capability "noReset" to true, you ...


1

Instead of running the click straight away you can iterate over the results and see if they are suitable before clicking them. foreach (button in self.driver.find_elements_by_name("button_name")) if button.property == 'what i want' button.click() You can add other constraints on the button by adjusting the if statements. Nothing inside the ...


1

I learn Appium using multiple resources, I found online stuff and experimental project for android & iOS App. Just google "Appium tutorial", I will suggest don't stick with any programing language(like python), it's just a medium to express code. In my case, I learn Appium using JAVA but I implemented using C#, You can cover up if you have good command ...


1

Your solution is good. But if it's only different from locators but same steps. I usually use only xpath and separate string of locators from each page. public class aLogin{ string str_username = 'xpath to username text box of page A'; string str_password = 'xpath to password text box of page A'; } public class bLogin{ string str_username = 'xpath to ...


1

(c) clearly breaks the Single Responsibility Principle (SRP) (a) would result in duplicated code, which is solved by (b). A few other things you can do would depend on how you control the environment. You can have different login page objects for each user type, which implement the method login returning the user-specific main page. This way, you replace a ...


1

If the steps are really the same you could create an abstraction for all the Selenium commands and implement them also for the Appium implementation. But I guess the mobile version will probably will not be a 100% workflow match with the desktop browser version. Most mobile apps I use are a subset and slimmed down compared to their desktop/browser ...


1

Hope you are using Pom.xml to add dependencies.if that is the case check you have added bellow dependencies apart from appium dependencies. <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-remote-driver</artifactId> <version>2.44.0</version> </dependency> if you still ...


Only top voted, non community-wiki answers of a minimum length are eligible