MainMenu

Home Java Overview Maven Tutorials

Sunday, 9 April 2017

Automate Android Chrome Browser using Appium



For Video Tutorial : Move on Youtube Channel


Note : Select the playlist as per your need & move with number sequence


For Video : CLICK HERE


First of all connect your device with usb cable
Start appium
write & run the script
Scenarios :
Open the Andriod Chrome Browser
navigate to URL "www.way2testing.com"
Scroll the browser
click the link "appium tutorial with example"

import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.BrowserType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.Test;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.MobileCapabilityType;
public class Appauto
{
@Test
public void g() throws MalformedURLException, InterruptedException
{
//create object of DesiredCapabilities class
DesiredCapabilities capabilities = DesiredCapabilities.android();
//set the capability to execute test in chrome browser
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, BrowserType.CHROME);
//set the capability of Andriod platform
capabilities.setCapability(MobileCapabilityType.PLATFORM, Platform.ANDROID);
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Andriod");
//set the device name
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "7c94b480");
//set the andriod version
capabilities.setCapability(MobileCapabilityType.VERSION, "5.1");
//create object of URL class and specify the appium server address
URL url = new URL("http://127.0.0.1:4723/wd/hub");
WebDriver driver = new AndroidDriver(url, capabilities);
driver.get("http://www.way2testing.com");
Thread.sleep(5000);
JavascriptExecutor js = (JavascriptExecutor) driver;
//Scroll page down to 250px
js.executeScript("window.scrollBy(0,750)", "");
driver.findElement(By.linkText("Appium Tutorials with example")).click();
Thread.sleep(5000);
}
}

42 comments:

  1. Hi there,
    Nice Article I really enjoyed this post Thanks For Sharing,
    Obtain ISO 9001 Certification It enhances your product & service quality, Increases marketing opportunities, Reduces your costs and much more.

    ISO 9001
    ISO 9001 Certification in Mira Road

    ReplyDelete
    Replies
    1. Great Article
      android based projects

      Java Training in Chennai

      Project Center in Chennai

      Java Training in Chennai

      projects for cse

      The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

      Delete
    2. Yoursomacod.com is the best usa based online pharmacy, get all Brand and Generic medicines without prescription with cash on delivery Service in the USA, at a discounted price.

      we helps you to provide information about prescription drugs that are prescribed to treat various kinds of diseases. We deliver our services in the United States, USA. To place your order as overnight delivery, you can choose your products and place them at any point in time and get it delivered the next day at your doorstep.

      Here are some medicine Yoursomacod.com provide with online prescription, they give information about medicine you want to buy. Visit their website for details

      Get 20% discount with cash on delivery in USA and Canada.

      Buy Xanax Online

      Buy Oxycodone Online

      Buy Percocet Online

      Buy Soma Online

      Buy Tramadol Online

      Buy Dilaudid Online

      Buy Fioricet Online

      Buy Oxycontin Online

      Buy Roxicodone Online

      Buy Klonopin Online

      Delete
  2. Hi there,

    Nice Article I really enjoyed this post Thanks For Sharing, check out this
    Ascent ASSOCIATES is one of Sri Lanka’s leading ‘total solutions’ providers, offering a simple, cost-effective route to ISO Certification in Colombo, Kandy, Galle, Dambulla, Sri Jayawardenepura Kotte & all over Sri Lanka.

    Ascent Associates

    ReplyDelete
  3. Enjoyed reading the article above, really explains everything in detail, the article is very interesting and effective. Thank you and good luck for the upcoming articles. Check this out

    ISO 22000 Certification in Mumbai

    ReplyDelete
  4. Hey there,
    Enjoyed reading the article above, really explains everything in detail, the article is very interesting and effective, Thanks for Sharing, check this out

    ISO 9001 Certification in Sri Lanka

    ReplyDelete
  5. This said there are sure things that are realized you can do to build your web crawler positioning and traffic to site, there are likewise numerous things you can do to harm your position. dark web links

    ReplyDelete
  6. Usually, I never comment on blogs but your article is so convincing that I never stop myself to say something about it. You’re doing a great job Man, Keep it up.

    Ascent World

    ReplyDelete
  7. Remarkable article. An obligation of appreciation is all together for sharing. KrogerStoresFeedback

    ReplyDelete
  8. Grateful to you, I should say to it's attractive post for blog. McDVOICE Survey

    ReplyDelete
  9. Amazing Article. Grateful to you, incredibly obliging.. does coconut flour expire

    ReplyDelete
  10. This applies to all kinds of tans - from a regular spray tan to an Airbrush glow to a UV tan. You can ask the professionals at your tanning salon about which one would work the best for you. Spray Tanning near me

    ReplyDelete
  11. The article was up to the point and described the information about education and learning. Thanks to blog author for wonderful and informative post. BPO providers

    ReplyDelete
  12. The article was up to the point and described the information about education and learning. Thanks to blog author for wonderful and informative post. disability podcast

    ReplyDelete
  13. The article was up to the point and described the information about education and learning. Thanks to blog author for wonderful and informative post. boaz derra

    ReplyDelete
  14. The article was up to the point and described the information about education and learning. Thanks to blog author for wonderful and informative post. disability insurance services

    ReplyDelete
  15. The article was up to the point and described the information about education and learning. Thanks to blog author for wonderful and informative post. alcohol detox centers in Florida

    ReplyDelete
  16. The article was up to the point and described the information about education and learning. Thanks to blog author for wonderful and informative post. Bitcoin machine near me

    ReplyDelete
  17. Thank you for the good writeup. It in fact was a amusement account it.

    Look advanced to far added agreeable from you! By the way, how could we communicate?
    Shalom Lamm

    ReplyDelete
  18. We will try to hold our overview up to date with brands that do accept players.
    Shalom Lamm

    ReplyDelete
  19. I have been surfing online more than 4 hours today, yet I never found any

    interesting article like yours. It's pretty worth enough for me.

    Personally, if all site owners and bloggers made good content

    as you did, the net will be much more useful than ever before.

    By the way, here is a link to fantastic site for earnings
    Shalom Lamm

    ReplyDelete
  20. I really like the knowledge you provide here and can't wait to take a look when I get home.

    I'm shocked at how quick your blog loaded on my mobile .. I'm not even using WIFI, just 3G ..

    Anyways, very good blog!
    Shalom Lamm

    ReplyDelete
  21. Great weblog here! Additionally your web site loads up fast!
    hyperlink for your host? I want my web site loaded up as fast as yours lol.
    Shalom Lamm

    ReplyDelete
  22. Great post. I was checking constantly this blog and I'm

    impressed! Extremely helpful info specially the last part :

    ) I care for such information much. I was seeking this certain info for

    a very long time. Thank you and good luck.
    Shalom Lamm

    ReplyDelete
  23. Thanks for the nice blog. It was very useful for me.
    Shalom Lamm

    ReplyDelete
  24. The article was up to the point and described the information about education and learning. Thanks to blog author for wonderful and informative post. Local AA Meetings

    ReplyDelete
  25. The article was up to the point and described the information about education and learning. Thanks to blog author for wonderful and informative post. Funding For Business

    ReplyDelete
  26. The article was up to the point and described the information about education and learning. Thanks to blog author for wonderful and informative post. Sober Living

    ReplyDelete
  27. Docsignpro provide document online signature services
    The electronic signature online application presents a great opportunity.
    Modern businesses require a digital partner to boost their document management. DocSignPro is going to be your perfect partner when inserting digital signature online pdf documents...


    docsignpro

    ReplyDelete
  28. What a great content we have here buy painkillers online as we browse we also see this blog too and is pretty good buy Percocet online we also realize that blog are good for business we also bring buy vyvanse online best blog to visit

    ReplyDelete
  29. The article was up to the point and described the information about education and learning. Thanks to blog author for wonderful and informative post. AA Meeting Directory

    ReplyDelete
  30. The article was up to the point and described the information about education and learning. Thanks to blog author for wonderful and informative post. Holistic Wellness Blog

    ReplyDelete
  31. your articles are such written in a good way
    https://www.law.com/legalnewswire/news.php?id=2862814

    ReplyDelete
  32. every point is discussed in your article
    https://keyposting.com/simplest-ecommerce-website-builder-richart-ruddie-annuity/

    ReplyDelete
  33. your articles are extremely good and well described every point
    https://www.dorjblog.com/richart-ruddie-annuity-describes-telemarketings-pros-and-cons/

    ReplyDelete
  34. keep going like these articles
    https://postpear.com/e-commerce-web-site-builder-by-richart-ruddie-annuity/

    patch.com

    ReplyDelete
  35. really good articles
    https://vocal.media/01/richart-ruddie-annuity-views-on-importance-of-digital-marketing

    ReplyDelete
  36. i enjoyed your articles
    https://theblogulator.com/richart-ruddie-annuity-reviews-on-a-telemarketing-agency/

    ReplyDelete
  37. i am very greatful to you you about your work
    https://sketchfab.com/Richart.Ruddie.Annuity

    ReplyDelete
  38. good work bro
    https://sketchfab.com/Richart.Ruddie.Annuity

    ReplyDelete
  39. http://www.way2testing.com/2017/04/automate-android-chrome-browser-using.html?showComment=1634192486999#c5164076129840033135

    ReplyDelete