Parallel execution & paramitarization

By using Appium studio parallel execution is possible??
if it is possible how to do parallel execution??
how many devices we can able to run script at a time??
how to do parallel execution
Thanks in advance

Paramitarization is possible or not by using appiumstudio

hi,
You can run 2 tests in parallel. Nothing special need to be done.
You can use TestNG or Ant to configure the execution and the parameters. One way to pass parameters is by using system properties.

we will upload a project shortly which will allow you to perform parallel execution from an IDE such as Eclipse or IntellJ

2 Likes

can u please upload a project that allow for parellel execution from eclipse as soon as possible…

Hi

We recently had a webinar where we demonstrated how can you run tests in parallel using TestNG

I’ve attached here a link to the webinar example, and a GitHub project

https://goo.gl/rHAhPy

You can run parallel tests using testng which is a library you need to include in your project. TESTNG also have some good features like Listeners, dataProviders, Test, Before and After Class/Method/Suite. For more info about how to use Testng follow: www.testng.org/

Hello,

I try to run parallel test in IntelliJ but the build failed. And I cannot find the reason why T__T. I saw some topics about build.gradle failed but these one closed and I cannot ask for more information.

Any help would be much appreciated.

Thanks

The errors in the console indicate that the build failed because gradle was unable to fetch the dependencies. Seems like a temporary issue related to network connectivity.

Are you still having issues with running the test?

If you managed to solve the build issue but are still having issues running the test in parallel, can you please provide us with the testng.xml file?

Thanks @nivi for your response.

Maybe it is caused by my company network. It is not allowed to go to the links. I checked with browsers and it cannot redirect too.

So, I imported jar file and just run testng.xml file but got this error. Do you have any ideas?

I tried to search on Internet but still cannot solve this one.

I really appreciate any help you can provide.

I think it’s related to the test package.
What is the test package? if it’s Demo then it’s find.
If you don’t have a package to the tests, then it should also be removed from the xml class tag.

Hello @guy,

Class AndroidTest and iOSTest are in package Demo.

Can you past the code of the test.

@guy Yes, here you are

  1. AndroidTest

package Demo;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.AndroidMobileCapabilityType;
import io.appium.java_client.remote.MobileCapabilityType;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

import java.net.MalformedURLException;
import java.net.URL;

public class AndroidTest {
private String reportDirectory = “reports”;
private String reportFormat = “xml”;
private String testName = “Untitled”;
protected AndroidDriver driver = null;

@Before
public void setUp() throws MalformedURLException {
    DesiredCapabilities dc = new DesiredCapabilities();
    dc.setCapability("reportDirectory", reportDirectory);
    dc.setCapability("reportFormat", reportFormat);
    dc.setCapability("testName", testName);
    dc.setCapability(MobileCapabilityType.UDID, "192.168.173.102:5555");
    dc.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, "com.accor.appli.hybrid");
    dc.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, "fr.accor.core.ui.activity.ContainerActivity");
    driver = new AndroidDriver(new URL("http://localhost:4723/wd/hub"), dc);
}

@Test
public void testUntitled() {
    driver.findElement(By.xpath("//*[@contentDescription='Navigate up']")).click();
    driver.findElement(By.xpath("//*[@text='Log In']")).click();
    new WebDriverWait(driver, 10).until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@id='mailField']")));
    driver.findElement(By.xpath("//*[@id='mailField']")).sendKeys("25572568");
    driver.findElement(By.xpath("//*[@id='passwordField']")).sendKeys("passwd1");
    new WebDriverWait(driver, 30).until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@text='Log in']")));
    driver.findElement(By.xpath("//*[@text='Log in']")).click();
}

@After
public void tearDown() {
    driver.quit();
}

}

  1. iOSTest

package Demo;

/**

  • Created by thi-ly.tran on 07/08/2017.
    */
    //package ;
    import io.appium.java_client.ios.IOSDriver;
    import io.appium.java_client.remote.IOSMobileCapabilityType;
    import io.appium.java_client.remote.MobileCapabilityType;
    import org.junit.After;
    import org.junit.Before;
    import org.junit.Test;
    import org.openqa.selenium.By;
    import org.openqa.selenium.remote.DesiredCapabilities;
    import org.openqa.selenium.support.ui.ExpectedConditions;
    import org.openqa.selenium.support.ui.WebDriverWait;

import java.net.MalformedURLException;
import java.net.URL;

public class iOSTest {
private String reportDirectory = “reports”;
private String reportFormat = “xml”;
private String testName = “Untitled”;
protected IOSDriver driver = null;

@Before
public void setUp() throws MalformedURLException {
    DesiredCapabilities dc = new DesiredCapabilities();
    dc.setCapability("reportDirectory", reportDirectory);
    dc.setCapability("reportFormat", reportFormat);
    dc.setCapability("testName", testName);
    dc.setCapability(MobileCapabilityType.UDID, "fe9902dbe36de0689f9531584418767a0097ffb8");
    dc.setCapability(IOSMobileCapabilityType.BUNDLE_ID, "fr.accor.push.inhouse");
    driver = new IOSDriver(new URL("http://localhost:4723/wd/hub"), dc);
}

@Test
public void testUntitled() {
    driver.findElement(By.xpath("//*[@placeholder='Destination']")).click();
    new WebDriverWait(driver, 10).until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@placeholder='Destination']")));
    driver.findElement(By.xpath("//*[@placeholder='Destination']")).sendKeys("0446");
    new WebDriverWait(driver, 10).until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@text=concat('Search ', '\"', '0446', '\"', '')]")));
    driver.findElement(By.xpath("//*[@text=concat('Search ', '\"', '0446', '\"', '')]")).click();
    new WebDriverWait(driver, 10).until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@text='Search']")));
    driver.findElement(By.xpath("//*[@text='Search']")).click();
}

@After
public void tearDown() {
    driver.quit();
        }

}

Hi,
The @Test tag you are using it JUnit tag and the xml is TestNG…

@guy
Aishhhhh, sorry, my bad. Thank you for pointing it out. I run testng.xml file successfully. But I didn’t see any log on eclipse.

And one more thing, I followed this link to get the report but cannot find getReportFolder in the suggestion list

http://appium.experitest.com/t/unable-to-get-test-reports/122

Could you please explain it for me or did I do something wrong?

Thank you

Try the followings:
File reportsDir = new File(“c:\temp\reports”);
reportsDir.mkdirs();
dc.setCapability(“reportDirectory”, reportsDir.getAbsolutePath());

Hi,

I am able to run parallel execution successfully.

Application launches successfully,but when it sends Test data from data provider its sends in NON-SYNC .

How to resolve this issue ? any solution ?

Need help on this.

Thanks in advance