SlideShare a Scribd company logo
Browser_Stack_Intro
What is Browser Stack?
• Browser Stack is an cloud web and mobile testing platform that provides developers with
the ability to test their websites and mobile applications across on-demand browsers,
operating systems and real mobile devices. They have following primary products:
Why Browser Stack?
1. we can avoidthe
hassle of having to
buy all the mobile
devices that are
availabletodayto
perform
the testing.
2.We can use
Browser Stack as a
remote lab, and we
can even use it as
Real Desktop
Browsers or
MobileBrowsers.
3. There is no setup
required for using
Browser Stack.
4. We can use it
directly on any
independent
machine by using
the Browser Stack
URL and its
login credentials
Typesof Live
Testing
These Kind of testing we can do on the browser stack platform.
with
with
• Access the Browser stack URL: https://www.browserstack.com/
This attachmentis as per latest browser stack UI, it might get modified in future.
AvailableOS forthe livetesting.
2. Choose Live option
We have Live,
Automate and Percy
options for websites
testing as per current
UI.
3. enter the testing URL and click on Start Test
4. Choose OS(Window or Mac) and Browser(chrome, Firefox, IE etc.) for Web testing or Real
devices for mobile testing.
Login page is appeared after accessing the URL.
We can reportany issuesto JIRAfromtheBrowserstacktesting
platformafterclickingon reporta bug(observe in previous
slide).
Since we are using trial version we will be getting 1 min of access of each browser. If we want
some more time then need to purchase a plan. This screen will appear once we will try to use
same browser version which is already used once.
Browser Stack Automate option helps to run the automation script on the
browser stack platform. We can select the specific browser and OS where
we want to run the automated scripts. That will provide us snippet of code
which we can copy and paste in our framework.
Clickon AutomateoptionavailablerighttoBrowserStack logoandfollowtheStepsto
get thesnippet ofcodes.
Select thetestOS andBrowser and thencopy thecode andpaste insideyourframework.
Note: Add this snippet of code and execute the automatedscripts. Automationscript
will execute on the browser stack platform and execution detailswill be getting
generated.
Observe The
execution result
on the Browser
stack platform
Note: Browser stack generates the execution video recording which we can get on the same screen by
scrolling window little bit down. Observe next slide.
Browser stack execution summary in form of recording. We
can expand it and get some more details.
We can play
and observe
the
recording, do
wnload the
recording or
can get
different exec
ution logs
from here.
Note: We can direct report bug in JIRA after integrating Jira. We haveReport bug option at top right corner next to delete
session.
It helps to Instant access to Real Device Cloudand Test nativeand hybridapps on its wide range of physicalmobile and
tablet devices for the most accuratetesting results.
List of BrowserStack RealMobile& Tablet Devicesfor App LiveTesting
Browser_Stack_Intro
App Live
home
screen
We can installthe
app from different
sources
for the testing as
mentioned under
select source
section
Upload your app option:
We can select the upload your
app option and click on upload
option it will ask for apk
location and once you select it
will start download. Later we
need to select one device and
it will launch the application in
same device.
Install via play store: you need to click on installvia play store optionand select test device. Later it will ask for sign
in credentialand then you can installit from playstore.
Note: Sign in credentialis require for test flight also.
• Browser Stack App Automate enables you to test
native and hybrid mobile applications using Appium
automation framework. It's easy to run your Appium
tests written in Java on real Android and iOS devices
on Browser Stack.
Runyourfirst Build
Runa sampleTestNGtestbuildon BrowserStack by changing a fewlines in the
codeusingthesesimplesteps:
// Maven users can add this dependency to project's POM
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>7.0.0</version>
</dependency>
Step 2:
Example:
/* Note the "app_url" valuefor the sample app. Thisvalue
uniquelyidentifies the app on Browser Stack. */
{"app_url":"bs://c700ce60cf13ae8ed97705a55b8e022f13c58
27c"}
/* In your test script, use this "app_url"value to specify the
applicationunder test using the "app"capability.During test
execution, the sample app will automaticallybe installedand
launchedon the device being tested. */
caps.setCapability("app",
"bs://c700ce60cf13ae8ed97705a55b8e022f13c5827c")
Steps3:
Configuretestscript
• Using desiredcapabilities
Desired capabilitiesare a series of key-valuepairs
that allow you to configure your Appium tests on
Browser Stack. Let's start with most importantones.
• Set access credentials
Use browser stack. user and browser stack.
key variables to set your Browser Stack access
credentialsThisis required to authenticateyour tests.
• Specify application under test
Use the app capabilityto specify your uploadedapp
that will be installedon device during test execution.
Set its valueusing the app_urlobtainedin Step 2.
• Set the device to run the test on
Use the device and os_version capabilityto specify
the device for testing.
a. Android. b. Google Pixel 3[observe different
availabledevices in next couple of slides]
• Create remote web driver
Next, initializea remote web driver to start a new test
session on Browser Stack. You are all set to remotely
test your app on Browser Stack devices!
• Write a test case
Add an existing test case or write a new one using
different Appium commands. We haveprovided a
test case for our sample app but make sure you edit it
to test your own app !
List of Browser StackReal Mobile &
TabletDevices for AppAutomate
Testing
Browser_Stack_Intro
package android;
import java.net.URL;
import java.util.List;
import java.util.function.Function;
import java.net.MalformedURLException;
import io.appium.java_client.MobileBy;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
public class BrowserStackSample {
public static void main(String[] args) throws MalformedURLException, InterruptedException {
DesiredCapabilities caps = new DesiredCapabilities();
// Set your access credentials
caps.setCapability("browserstack.user", "mithileshsingh_D98GPT");
caps.setCapability("browserstack.key", "DvpabBSodXe2oklk4CCd");
// Set URL of the application under test
caps.setCapability("app", "bs://c700ce60cf13ae8ed97705a55b8e022f13c5827c");
// Specify device and os_version for testing
caps.setCapability("device", "Google Pixel 3");
caps.setCapability("os_version", "9.0");
// Set other BrowserStack capabilities
caps.setCapability("project", "First Java Project");
caps.setCapability("build", "browserstack-build-1");
// Initialise the remote Webdriver using BrowserStack remote URL
// and desired capabilities defined above
AndroidDriver<AndroidElement> driver = new AndroidDriver<AndroidElement>(
new URL("http://hub.browserstack.com/wd/hub"), caps);
// Test case for the BrowserStack sample Androidapp.
// If you have uploadedyourapp, update the test case here.
AndroidElement searchElement = (AndroidElement) new WebDriverWait(driver,
30).until(
ExpectedConditions.elementToBeClickable(
MobileBy.AccessibilityId("Search Wikipedia")));
searchElement.click();
AndroidElement insertTextElement = (AndroidElement)
new WebDriverWait(driver, 30).until(
ExpectedConditions.elementToBeClickable(
MobileBy.id("org.wikipedia.alpha:id/search_src_text")));
insertTextElement.sendKeys("BrowserStack");
Thread.sleep(5000);
List<AndroidElement> allProductsName = driver.findElementsByClassName(
"android.widget.TextView");
assert(allProductsName.size() > 0);
// Invoke driver.quit() after the test is done to indicate that the test is
completed.
driver.quit();
}
}
Example code
this is applicable in my case, Browser
stack will suggest code for you once
you will login and navigate to app
automate option and select your OS
and device.
Step4:
Executeyourtestscript
• You are now ready to run your first
Appium test on Browser Stack. Copy the
code snippet on right side and paste it in
your local file. On your local machine,
open the terminal/command prompt and
navigate to the folder containing your test
script. Build and run the test script just like
any other Java program using your
project’s preferred build tools (E.g. Maven,
Gradle).
# Using Maven
mvn test -P <android-first-test>
Viewtestresultson dashboard
This is same which we discussed in Browser Stack automateoption. That
was for web testing and this (app automate) is for mobile testing
BrowserStack Integrations
Cypress.io
Jenkins
Selenium
Bitbucket
Circle CI
GitHub
TravisCI
WordPress
Visual Studio IDE
Appium
Jira Software
Trello
Slack
Earl Grey
Espresso
Javascript Testing
BrowserStack Competitors
• Sauce Labs
• Perfecto, by Perforce
• Experitest
• Cross Browser Testing
• Lambda Test
• AWS Device Farm
Note:
• I am not covering Percy tool in this ppt because
it's a separate topic which deals with visual
testing. So will cover this in visual testing
introduction ppt.
• If you want to see the end to end test framework
integrated with Browser stack platform visit this
link: https://github.com/mithilesh777/softwaret
esting/tree/master/Selenium_BS_integration
Mithilesh Singh

More Related Content

What's hot (20)

PPTX
Cross browser testing with browser stack
Denys Poloka
 
PDF
Ship quality mobile apps with speed [Webinar]
BrowserStack
 
PDF
Cross-Browser-Testing with Protractor & Browserstack
Leo Lindhorst
 
PPTX
Mobile Automation with Appium
Manoj Kumar Kumar
 
PPTX
TestNG Framework
Levon Apreyan
 
PPT
Test Automation Framework Designs
Sauce Labs
 
PPTX
Test Automation and Selenium
Karapet Sarkisyan
 
PDF
Cross browser testing using BrowserStack
RapidValue
 
PPTX
API Testing for everyone.pptx
Pricilla Bilavendran
 
PDF
Appium: Automation for Mobile Apps
Sauce Labs
 
PDF
Robot Framework Introduction
Pekka Klärck
 
PDF
Automation Testing using Selenium
Naresh Chintalcheru
 
PPTX
Introduction to selenium
Archana Krushnan
 
PPTX
Selenium test automation
Srikanth Vuriti
 
PDF
Test Automation
rockoder
 
PPT
Automation With A Tool Demo
Nivetha Padmanaban
 
PPTX
Cypress Automation
Susantha Pathirana
 
PDF
Cucumber ppt
Qwinix Technologies
 
PPTX
Automation Testing
Sun Technlogies
 
PPTX
Appium Presentation
OmarUsman6
 
Cross browser testing with browser stack
Denys Poloka
 
Ship quality mobile apps with speed [Webinar]
BrowserStack
 
Cross-Browser-Testing with Protractor & Browserstack
Leo Lindhorst
 
Mobile Automation with Appium
Manoj Kumar Kumar
 
TestNG Framework
Levon Apreyan
 
Test Automation Framework Designs
Sauce Labs
 
Test Automation and Selenium
Karapet Sarkisyan
 
Cross browser testing using BrowserStack
RapidValue
 
API Testing for everyone.pptx
Pricilla Bilavendran
 
Appium: Automation for Mobile Apps
Sauce Labs
 
Robot Framework Introduction
Pekka Klärck
 
Automation Testing using Selenium
Naresh Chintalcheru
 
Introduction to selenium
Archana Krushnan
 
Selenium test automation
Srikanth Vuriti
 
Test Automation
rockoder
 
Automation With A Tool Demo
Nivetha Padmanaban
 
Cypress Automation
Susantha Pathirana
 
Cucumber ppt
Qwinix Technologies
 
Automation Testing
Sun Technlogies
 
Appium Presentation
OmarUsman6
 

Similar to Browser_Stack_Intro (20)

PPT
Appium
Deepshikha Singh
 
PDF
Automating Mobile Web Browsers with Appium.pdf
flufftailshop
 
PPT
Android & iOS Automation Using Appium
Mindfire Solutions
 
PPTX
Appium overview
Abhishek Yadav
 
PDF
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
kalichargn70th171
 
PDF
Getting started with appium
Pratik Patel
 
PPTX
The wild wild west of Selenium Capabilities
Adi Ofri
 
PDF
Java Test Automation for REST, Web and Mobile
Elias Nogueira
 
PPT
Appium
Keshav Kashyap
 
PPTX
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptx
Matthew Allen
 
PDF
How to kill test flake in appium
Gaurav Singh
 
PPTX
Appium solution artizone
Nael Abd Eljawad
 
PDF
Appium workship, Mobile Web+Dev Conference
Isaac Murchie
 
PPTX
Appium overview session final
Abhishek Yadav
 
PDF
Appium mobile web+dev conference
Isaac Murchie
 
PDF
Appium understanding document
Akshay Pillay
 
PDF
Top 5 BrowserStack Alternatives That Are Present In The Market.pdf
Jace Reed
 
PPTX
QA Fest 2014. Ярослав Пернеровский. Appium - два в одном. рецепт приготовлени...
QAFest
 
PPTX
Comprehensive Guide to UI & API Test Automation.pptx
mahmoudkhalilunoinco
 
PDF
How to Test Android and iOS Mobile Apps with Appium.pdf
kalichargn70th171
 
Automating Mobile Web Browsers with Appium.pdf
flufftailshop
 
Android & iOS Automation Using Appium
Mindfire Solutions
 
Appium overview
Abhishek Yadav
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
kalichargn70th171
 
Getting started with appium
Pratik Patel
 
The wild wild west of Selenium Capabilities
Adi Ofri
 
Java Test Automation for REST, Web and Mobile
Elias Nogueira
 
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptx
Matthew Allen
 
How to kill test flake in appium
Gaurav Singh
 
Appium solution artizone
Nael Abd Eljawad
 
Appium workship, Mobile Web+Dev Conference
Isaac Murchie
 
Appium overview session final
Abhishek Yadav
 
Appium mobile web+dev conference
Isaac Murchie
 
Appium understanding document
Akshay Pillay
 
Top 5 BrowserStack Alternatives That Are Present In The Market.pdf
Jace Reed
 
QA Fest 2014. Ярослав Пернеровский. Appium - два в одном. рецепт приготовлени...
QAFest
 
Comprehensive Guide to UI & API Test Automation.pptx
mahmoudkhalilunoinco
 
How to Test Android and iOS Mobile Apps with Appium.pdf
kalichargn70th171
 
Ad

More from Mithilesh Singh (20)

PPTX
End2EndTesting_With_GenerativeAI - ChatGPT
Mithilesh Singh
 
PPTX
GITHUB_ACTIONS_CICD_OVERVIEW_FOR_BEGINNERS
Mithilesh Singh
 
PDF
Cucumber Basics.pdf
Mithilesh Singh
 
PDF
Data Migration.pdf
Mithilesh Singh
 
PDF
SDLC Models.pdf
Mithilesh Singh
 
PDF
Test_Case_Design_Techniques
Mithilesh Singh
 
PDF
Performance Testing
Mithilesh Singh
 
PDF
Software_requirement_collection
Mithilesh Singh
 
PDF
Stub_&_Drive
Mithilesh Singh
 
PDF
Functional_Testing_Part-1
Mithilesh Singh
 
PDF
TestersMindSet 2022
Mithilesh Singh
 
PDF
API_Testing_with_Postman
Mithilesh Singh
 
PDF
Agile_basics
Mithilesh Singh
 
PDF
Selenium_Grid
Mithilesh Singh
 
PDF
Appium_set_up
Mithilesh Singh
 
PDF
Appium- part 1
Mithilesh Singh
 
PDF
Alpha & Beta Testing
Mithilesh Singh
 
PDF
Severity and Priority
Mithilesh Singh
 
PDF
GIT_Overview.
Mithilesh Singh
 
PPTX
Selenium-Locators
Mithilesh Singh
 
End2EndTesting_With_GenerativeAI - ChatGPT
Mithilesh Singh
 
GITHUB_ACTIONS_CICD_OVERVIEW_FOR_BEGINNERS
Mithilesh Singh
 
Cucumber Basics.pdf
Mithilesh Singh
 
Data Migration.pdf
Mithilesh Singh
 
SDLC Models.pdf
Mithilesh Singh
 
Test_Case_Design_Techniques
Mithilesh Singh
 
Performance Testing
Mithilesh Singh
 
Software_requirement_collection
Mithilesh Singh
 
Stub_&_Drive
Mithilesh Singh
 
Functional_Testing_Part-1
Mithilesh Singh
 
TestersMindSet 2022
Mithilesh Singh
 
API_Testing_with_Postman
Mithilesh Singh
 
Agile_basics
Mithilesh Singh
 
Selenium_Grid
Mithilesh Singh
 
Appium_set_up
Mithilesh Singh
 
Appium- part 1
Mithilesh Singh
 
Alpha & Beta Testing
Mithilesh Singh
 
Severity and Priority
Mithilesh Singh
 
GIT_Overview.
Mithilesh Singh
 
Selenium-Locators
Mithilesh Singh
 
Ad

Recently uploaded (20)

PDF
Online Queue Management System for Public Service Offices in Nepal [Focused i...
Rishab Acharya
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PDF
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Online Queue Management System for Public Service Offices in Nepal [Focused i...
Rishab Acharya
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 

Browser_Stack_Intro

  • 2. What is Browser Stack? • Browser Stack is an cloud web and mobile testing platform that provides developers with the ability to test their websites and mobile applications across on-demand browsers, operating systems and real mobile devices. They have following primary products:
  • 3. Why Browser Stack? 1. we can avoidthe hassle of having to buy all the mobile devices that are availabletodayto perform the testing. 2.We can use Browser Stack as a remote lab, and we can even use it as Real Desktop Browsers or MobileBrowsers. 3. There is no setup required for using Browser Stack. 4. We can use it directly on any independent machine by using the Browser Stack URL and its login credentials
  • 4. Typesof Live Testing These Kind of testing we can do on the browser stack platform.
  • 6. • Access the Browser stack URL: https://www.browserstack.com/ This attachmentis as per latest browser stack UI, it might get modified in future.
  • 8. 2. Choose Live option We have Live, Automate and Percy options for websites testing as per current UI.
  • 9. 3. enter the testing URL and click on Start Test
  • 10. 4. Choose OS(Window or Mac) and Browser(chrome, Firefox, IE etc.) for Web testing or Real devices for mobile testing.
  • 11. Login page is appeared after accessing the URL.
  • 12. We can reportany issuesto JIRAfromtheBrowserstacktesting platformafterclickingon reporta bug(observe in previous slide).
  • 13. Since we are using trial version we will be getting 1 min of access of each browser. If we want some more time then need to purchase a plan. This screen will appear once we will try to use same browser version which is already used once.
  • 14. Browser Stack Automate option helps to run the automation script on the browser stack platform. We can select the specific browser and OS where we want to run the automated scripts. That will provide us snippet of code which we can copy and paste in our framework.
  • 16. Select thetestOS andBrowser and thencopy thecode andpaste insideyourframework.
  • 17. Note: Add this snippet of code and execute the automatedscripts. Automationscript will execute on the browser stack platform and execution detailswill be getting generated.
  • 18. Observe The execution result on the Browser stack platform Note: Browser stack generates the execution video recording which we can get on the same screen by scrolling window little bit down. Observe next slide.
  • 19. Browser stack execution summary in form of recording. We can expand it and get some more details.
  • 20. We can play and observe the recording, do wnload the recording or can get different exec ution logs from here. Note: We can direct report bug in JIRA after integrating Jira. We haveReport bug option at top right corner next to delete session.
  • 21. It helps to Instant access to Real Device Cloudand Test nativeand hybridapps on its wide range of physicalmobile and tablet devices for the most accuratetesting results.
  • 22. List of BrowserStack RealMobile& Tablet Devicesfor App LiveTesting
  • 24. App Live home screen We can installthe app from different sources for the testing as mentioned under select source section
  • 25. Upload your app option: We can select the upload your app option and click on upload option it will ask for apk location and once you select it will start download. Later we need to select one device and it will launch the application in same device.
  • 26. Install via play store: you need to click on installvia play store optionand select test device. Later it will ask for sign in credentialand then you can installit from playstore. Note: Sign in credentialis require for test flight also.
  • 27. • Browser Stack App Automate enables you to test native and hybrid mobile applications using Appium automation framework. It's easy to run your Appium tests written in Java on real Android and iOS devices on Browser Stack.
  • 28. Runyourfirst Build Runa sampleTestNGtestbuildon BrowserStack by changing a fewlines in the codeusingthesesimplesteps: // Maven users can add this dependency to project's POM <dependency> <groupId>io.appium</groupId> <artifactId>java-client</artifactId> <version>7.0.0</version> </dependency>
  • 29. Step 2: Example: /* Note the "app_url" valuefor the sample app. Thisvalue uniquelyidentifies the app on Browser Stack. */ {"app_url":"bs://c700ce60cf13ae8ed97705a55b8e022f13c58 27c"} /* In your test script, use this "app_url"value to specify the applicationunder test using the "app"capability.During test execution, the sample app will automaticallybe installedand launchedon the device being tested. */ caps.setCapability("app", "bs://c700ce60cf13ae8ed97705a55b8e022f13c5827c")
  • 30. Steps3: Configuretestscript • Using desiredcapabilities Desired capabilitiesare a series of key-valuepairs that allow you to configure your Appium tests on Browser Stack. Let's start with most importantones. • Set access credentials Use browser stack. user and browser stack. key variables to set your Browser Stack access credentialsThisis required to authenticateyour tests. • Specify application under test Use the app capabilityto specify your uploadedapp that will be installedon device during test execution. Set its valueusing the app_urlobtainedin Step 2. • Set the device to run the test on Use the device and os_version capabilityto specify the device for testing. a. Android. b. Google Pixel 3[observe different availabledevices in next couple of slides] • Create remote web driver Next, initializea remote web driver to start a new test session on Browser Stack. You are all set to remotely test your app on Browser Stack devices! • Write a test case Add an existing test case or write a new one using different Appium commands. We haveprovided a test case for our sample app but make sure you edit it to test your own app !
  • 31. List of Browser StackReal Mobile & TabletDevices for AppAutomate Testing
  • 33. package android; import java.net.URL; import java.util.List; import java.util.function.Function; import java.net.MalformedURLException; import io.appium.java_client.MobileBy; import io.appium.java_client.android.AndroidDriver; import io.appium.java_client.android.AndroidElement; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import org.openqa.selenium.WebDriver; import org.openqa.selenium.remote.DesiredCapabilities; public class BrowserStackSample { public static void main(String[] args) throws MalformedURLException, InterruptedException { DesiredCapabilities caps = new DesiredCapabilities(); // Set your access credentials caps.setCapability("browserstack.user", "mithileshsingh_D98GPT"); caps.setCapability("browserstack.key", "DvpabBSodXe2oklk4CCd"); // Set URL of the application under test caps.setCapability("app", "bs://c700ce60cf13ae8ed97705a55b8e022f13c5827c"); // Specify device and os_version for testing caps.setCapability("device", "Google Pixel 3"); caps.setCapability("os_version", "9.0"); // Set other BrowserStack capabilities caps.setCapability("project", "First Java Project"); caps.setCapability("build", "browserstack-build-1"); // Initialise the remote Webdriver using BrowserStack remote URL // and desired capabilities defined above AndroidDriver<AndroidElement> driver = new AndroidDriver<AndroidElement>( new URL("http://hub.browserstack.com/wd/hub"), caps); // Test case for the BrowserStack sample Androidapp. // If you have uploadedyourapp, update the test case here. AndroidElement searchElement = (AndroidElement) new WebDriverWait(driver, 30).until( ExpectedConditions.elementToBeClickable( MobileBy.AccessibilityId("Search Wikipedia"))); searchElement.click(); AndroidElement insertTextElement = (AndroidElement) new WebDriverWait(driver, 30).until( ExpectedConditions.elementToBeClickable( MobileBy.id("org.wikipedia.alpha:id/search_src_text"))); insertTextElement.sendKeys("BrowserStack"); Thread.sleep(5000); List<AndroidElement> allProductsName = driver.findElementsByClassName( "android.widget.TextView"); assert(allProductsName.size() > 0); // Invoke driver.quit() after the test is done to indicate that the test is completed. driver.quit(); } } Example code this is applicable in my case, Browser stack will suggest code for you once you will login and navigate to app automate option and select your OS and device.
  • 34. Step4: Executeyourtestscript • You are now ready to run your first Appium test on Browser Stack. Copy the code snippet on right side and paste it in your local file. On your local machine, open the terminal/command prompt and navigate to the folder containing your test script. Build and run the test script just like any other Java program using your project’s preferred build tools (E.g. Maven, Gradle). # Using Maven mvn test -P <android-first-test>
  • 35. Viewtestresultson dashboard This is same which we discussed in Browser Stack automateoption. That was for web testing and this (app automate) is for mobile testing
  • 36. BrowserStack Integrations Cypress.io Jenkins Selenium Bitbucket Circle CI GitHub TravisCI WordPress Visual Studio IDE Appium Jira Software Trello Slack Earl Grey Espresso Javascript Testing
  • 37. BrowserStack Competitors • Sauce Labs • Perfecto, by Perforce • Experitest • Cross Browser Testing • Lambda Test • AWS Device Farm
  • 38. Note: • I am not covering Percy tool in this ppt because it's a separate topic which deals with visual testing. So will cover this in visual testing introduction ppt. • If you want to see the end to end test framework integrated with Browser stack platform visit this link: https://github.com/mithilesh777/softwaret esting/tree/master/Selenium_BS_integration