Best Balin code snippet using com.github.epadronu.balin.core.Browser
Browser.kt
Source:Browser.kt
...31import kotlin.reflect.full.primaryConstructor32/* ***************************************************************************/33/* ***************************************************************************/34/**35 * Balin's backbone. The `Browser` interface binds together the different36 * abstractions that form part of the library.37 *38 * Additionally, this interface defines the entry point for the Domain-Specific39 * Language which Balin is built around.40 */41interface Browser : JavaScriptSupport, WaitingSupport, WebDriver {42 companion object {43 /**44 * The builder in charge of generating the configuration.45 */46 private val configurationBuilder: ConfigurationBuilder by ThreadLocalDelegate {47 ConfigurationBuilder()48 }49 /**50 * The name of the property that dictates which setup to use.51 */52 internal const val BALIN_SETUP_NAME_PROPERTY: String = "balin.setup.name"53 /**54 * Retrieves the configuration generated by the builder, taking in55 * account the value of the [BALIN_SETUP_NAME_PROPERTY] property.56 */57 internal val desiredConfiguration: ConfigurationSetup58 get() = configurationBuilder.build().run {59 setups[System.getProperty(BALIN_SETUP_NAME_PROPERTY) ?: "default"] ?: this60 }61 /**62 * Domain-Specific language that let's you configure Balin's global63 * behavior.64 *65 * @sample com.github.epadronu.balin.config.ConfigurationTests.call_the_configure_method_and_make_changes66 *67 * @param block here you can interact with the DSL.68 */69 fun configure(block: ConfigurationBuilder.() -> Unit) {70 block(configurationBuilder)71 }72 /**73 * This method represents the entry point for the Domain-Specific74 * Language which Balin is built around.75 *76 * `drive` is the main abstraction layer for Selenium-WebDriver. Inside77 * the [block] it receives as parameter, you can interact with the78 * driver and use all the features Balin has to offer.79 *80 * @sample com.github.epadronu.balin.core.BrowserTests.perform_a_simple_web_navigation81 *82 * @param driverFactory provides the driver on which the navigation and interactions will be performed.83 * @param autoQuit indicates if the driver should quit at the end of the [block].84 * @param block here you interact with the driver alongside of Balin's assistance.85 */86 fun drive(87 driverFactory: () -> WebDriver = desiredConfiguration.driverFactory,88 autoQuit: Boolean = desiredConfiguration.autoQuit,89 block: Browser.() -> Unit) = drive(Configuration(autoQuit, driverFactory), block)90 /**91 * This method represents the entry point for the Domain-Specific92 * Language which Balin is built around.93 *94 * `drive` is the main abstraction layer for Selenium-WebDriver. Inside95 * the [block] it receives as parameter, you can interact with the96 * driver and use all the features Balin has to offer.97 *98 * @sample com.github.epadronu.balin.core.BrowserTests.perform_a_simple_web_navigation99 *100 * @param configuration defines Balin's local behavior for [block] only.101 * @param block here you interact with the driver alongside of Balin's assistance.102 */103 fun drive(configuration: Configuration, block: Browser.() -> Unit) {104 val desiredConfiguration = configuration.run {105 setups[System.getProperty(BALIN_SETUP_NAME_PROPERTY) ?: "default"] ?: this106 }107 BrowserImpl(desiredConfiguration).apply {108 try {109 block()110 } catch (throwable: Throwable) {111 throw throwable112 } finally {113 if (configurationSetup.autoQuit) {114 quit()115 }116 }117 }118 }119 }120 /**121 * Tells the browser at what page it should be located.122 *123 * If the page defines an _implicit at verification_, then it will be124 * invoked immediately. If such verification fails, Balin will throw a125 * [PageImplicitAtVerificationException] in order to perform an early126 * failure.127 *128 * @sample com.github.epadronu.balin.core.BrowserTests.model_a_page_into_a_Page_Object_and_interact_with_it_via_the_at_method129 *130 * @param T the page's type.131 * @param factory provides an instance of the page given the driver being used by the browser.132 * @Returns An instance of the current page.133 * @throws PageImplicitAtVerificationException if the page has an _implicit at verification_ which have failed.134 */135 fun <T : Page> at(factory: (Browser) -> T): T = factory(this).apply {136 if (!verifyAt()) {137 throw PageImplicitAtVerificationException()138 }139 }140 /**141 * Navigates to the given page.142 *143 * If the page has not defined a URL, then a144 * [MissingPageUrlException] will be thrown immediately since145 * is not possible to perform the navigation.146 *147 * If the page defines an _implicit at verification_, then it148 * will be invoked immediately. If such verification fails, Balin149 * will throw a [PageImplicitAtVerificationException] in order to150 * perform an early failure.151 *152 * @sample com.github.epadronu.balin.core.BrowserTests.perform_a_simple_web_navigation153 *154 * @param T the page's type.155 * @param factory provides an instance of the page given the driver being used by the browser.156 * @Returns An instance of the current page.157 * @throws MissingPageUrlException if the page has not defined a URL.158 * @throws PageImplicitAtVerificationException if the page has an _implicit at verification_ which have failed.159 * @see org.openqa.selenium.WebDriver.get160 */161 fun <T : Page> to(factory: (Browser) -> T): T = factory(this).apply {162 get(url ?: throw MissingPageUrlException())163 if (!verifyAt()) {164 throw PageImplicitAtVerificationException()165 }166 }167 /**168 * Navigates to the given URL.169 *170 * @param url the URL the browser will navigate to.171 * @return The browser's current URL.172 *173 * @see org.openqa.selenium.WebDriver.get174 */175 fun to(url: String): String {176 get(url)177 return currentUrl178 }179}180/* ***************************************************************************/181/* ***************************************************************************/182/**183 * Switches to the currently active modal dialog for this particular driver instance.184 *185 * You can interact with the dialog handler only inside [alertContext].186 *187 * @sample com.github.epadronu.balin.core.WithAlertTests.validate_context_switching_to_and_from_an_alert_popup_and_accept_it188 *189 * @param alertContext here you can interact with the dialog handler.190 * @throws org.openqa.selenium.NoAlertPresentException If the dialog cannot be found.191 */192inline fun Browser.withAlert(alertContext: Alert.() -> Unit): Unit = try {193 switchTo().alert().run {194 alertContext()195 if (this == alertIsPresent().apply(driver)) {196 dismiss()197 }198 }199} catch (throwable: Throwable) {200 throw throwable201} finally {202 switchTo().defaultContent()203}204/**205 * Select a frame by its (zero-based) index and switch the driver's context to206 * it.207 *208 * Once the frame has been selected, all subsequent calls on the WebDriver209 * interface are made to that frame till the end of [iFrameContext].210 *211 * If a exception is thrown inside [iFrameContext], the driver will return to212 * its default context.213 *214 * @sample com.github.epadronu.balin.core.WithFrameTests.validate_context_switching_to_and_from_an_iframe_with_index215 *216 * @param index (zero-based) index.217 * @param iFrameContext here you can interact with the given IFrame.218 * @throws org.openqa.selenium.NoSuchFrameException If the frame cannot be found.219 */220inline fun Browser.withFrame(index: Int, iFrameContext: () -> Unit): Unit = try {221 switchTo().frame(index)222 iFrameContext()223} catch (throwable: Throwable) {224 throw throwable225} finally {226 switchTo().defaultContent()227}228/**229 * Select a frame by its name or ID. Frames located by matching name attributes230 * are always given precedence over those matched by ID.231 *232 * Once the frame has been selected, all subsequent calls on the WebDriver233 * interface are made to that frame till the end of [iFrameContext].234 *235 * If a exception is thrown inside [iFrameContext], the driver will return to236 * its default context.237 *238 * @sample com.github.epadronu.balin.core.WithFrameTests.validate_context_switching_to_and_from_an_iframe_with_id239 *240 * @param nameOrId the name of the frame window, the id of the <frame> or <iframe> element, or the (zero-based) index.241 * @param iFrameContext here you can interact with the given IFrame.242 * @throws org.openqa.selenium.NoSuchFrameException If the frame cannot be found.243 */244inline fun Browser.withFrame(nameOrId: String, iFrameContext: () -> Unit): Unit = try {245 switchTo().frame(nameOrId)246 iFrameContext()247} catch (throwable: Throwable) {248 throw throwable249} finally {250 switchTo().defaultContent()251}252/**253 * Select a frame using its previously located WebElement.254 *255 * Once the frame has been selected, all subsequent calls on the WebDriver256 * interface are made to that frame till the end of [iFrameContext].257 *258 * If a exception is thrown inside [iFrameContext], the driver will return to259 * its default context.260 *261 * @sample com.github.epadronu.balin.core.WithFrameTests.validate_context_switching_to_and_from_an_iframe_with_web_element262 *263 * @param webElement the frame element to switch to.264 * @param iFrameContext here you can interact with the given IFrame.265 * @throws org.openqa.selenium.NoSuchFrameException If the frame cannot be found.266 */267inline fun Browser.withFrame(webElement: WebElement, iFrameContext: () -> Unit): Unit = try {268 switchTo().frame(webElement)269 iFrameContext()270} catch (throwable: Throwable) {271 throw throwable272} finally {273 switchTo().defaultContent()274}275/**276 * Select a frame by its (zero-based) index and switch the driver's context to277 * it.278 *279 * Once the frame has been selected, all subsequent calls on the WebDriver280 * interface are made to that frame via a `Page Object` of type [T] till281 * the end of [iFrameContext].282 *283 * If a exception is thrown inside [iFrameContext], the driver will return to284 * its default context.285 *286 * @sample com.github.epadronu.balin.core.WithFrameTests.validate_context_switching_to_and_from_an_iframe_with_index_and_pages287 *288 * @param T the `Page Object`'s type.289 * @param index (zero-based) index.290 * @param iFrameContext here you can interact with the given IFrame via a `Page Object`.291 * @throws org.openqa.selenium.NoSuchFrameException If the frame cannot be found.292 */293inline fun <reified T : Page> Browser.withFrame(index: Int, iFrameContext: T.() -> Unit): Unit = try {294 switchTo().frame(index)295 @Suppress("UNCHECKED_CAST")296 iFrameContext(at(T::class.primaryConstructor as (Browser) -> T))297} catch (throwable: Throwable) {298 throw throwable299} finally {300 switchTo().defaultContent()301}302/**303 * Select a frame by its name or ID. Frames located by matching name attributes304 * are always given precedence over those matched by ID.305 *306 * Once the frame has been selected, all subsequent calls on the WebDriver307 * interface are made to that frame via a `Page Object` of type [T] till308 * the end of [iFrameContext].309 *310 * If a exception is thrown inside [iFrameContext], the driver will return to311 * its default context.312 *313 * @sample com.github.epadronu.balin.core.WithFrameTests.validate_context_switching_to_and_from_an_iframe_with_id_and_pages314 *315 * @param T the `Page Object`'s type.316 * @param nameOrId the name of the frame window, the id of the <frame> or <iframe> element, or the (zero-based) index.317 * @param iFrameContext here you can interact with the given IFrame via a `Page Object`.318 * @throws org.openqa.selenium.NoSuchFrameException If the frame cannot be found.319 */320inline fun <reified T : Page> Browser.withFrame(nameOrId: String, iFrameContext: T.() -> Unit): Unit = try {321 switchTo().frame(nameOrId)322 @Suppress("UNCHECKED_CAST")323 iFrameContext(at(T::class.primaryConstructor as (Browser) -> T))324} catch (throwable: Throwable) {325 throw throwable326} finally {327 switchTo().defaultContent()328}329/**330 * Select a frame using its previously located WebElement.331 *332 * Once the frame has been selected, all subsequent calls on the WebDriver333 * interface are made to that frame via a `Page Object` of type [T] till334 * the end of [iFrameContext].335 *336 * If a exception is thrown inside [iFrameContext], the driver will return to337 * its default context.338 *339 * @sample com.github.epadronu.balin.core.WithFrameTests.validate_context_switching_to_and_from_an_iframe_with_web_element_and_pages340 *341 * @param T the `Page Object`'s type.342 * @param webElement the frame element to switch to.343 * @param iFrameContext here you can interact with the given IFrame via a `Page Object`.344 * @throws org.openqa.selenium.NoSuchFrameException If the frame cannot be found.345 */346inline fun <reified T : Page> Browser.withFrame(webElement: WebElement, iFrameContext: T.() -> Unit): Unit = try {347 switchTo().frame(webElement)348 @Suppress("UNCHECKED_CAST")349 iFrameContext(at(T::class.primaryConstructor as (Browser) -> T))350} catch (throwable: Throwable) {351 throw throwable352} finally {353 switchTo().defaultContent()354}355/**356 * Switch the focus of future commands for this driver to the window with the357 * given name/handle.358 *359 * The name/handle can be omitted and the switching will be performed360 * automatically if and only if there is only two windows currently361 * opened.362 *363 * Once the window has been selected, all subsequent calls on the WebDriver364 * interface are made to that window till the end of [windowContext].365 *366 * If a exception is thrown inside [windowContext], the driver will return to367 * the previous window.368 *369 * @sample com.github.epadronu.balin.core.WithWindowTests.validate_context_switching_to_and_from_a_window370 *371 * @param nameOrHandle The name of the window or the handle as returned by [WebDriver.getWindowHandle]372 * @param windowContext Here you can interact with the given window.373 * @throws NoSuchWindowException If the window cannot be found or, in the case of no name or handle is indicated,374 * there is not exactly two windows currently opened.375 */376inline fun Browser.withWindow(nameOrHandle: String? = null, windowContext: WebDriver.() -> Unit) {377 val originalWindow = windowHandle378 val targetWindow = nameOrHandle ?: windowHandles.toSet().minus(originalWindow).run {379 when (size) {380 0 -> throw NoSuchWindowException("No new window was found")381 1 -> first()382 else -> throw NoSuchWindowException("The window cannot be determined automatically")383 }384 }385 try {386 switchTo().window(targetWindow).windowContext()387 } catch (throwable: Throwable) {388 throw throwable389 } finally {390 if (originalWindow != targetWindow && windowHandles.contains(targetWindow)) {...
ConfigurationSetupBuilder.kt
Source:ConfigurationSetupBuilder.kt
...21/* ***************************************************************************/22/* ***************************************************************************/23/**24 * Defines the builder used in the configuration DSL that can be interacted25 * with via the [com.github.epadronu.balin.core.Browser.configure] method.26 *27 * @see ConfigurationSetup28 * @sample com.github.epadronu.balin.config.ConfigurationTests.call_the_configure_method_and_make_changes29 *30 * @property autoQuit control whether the driver quits at the end of [com.github.epadronu.balin.core.Browser.drive].31 * @property driverFactory the factory that will create the driver to be used when invoking [com.github.epadronu.balin.core.Browser.drive].32 * @property waitForSleepTimeInMilliseconds control the amount of time between attempts when using [com.github.epadronu.balin.core.WaitingSupport.waitFor].33 * @property waitForTimeOutTimeInSeconds control the total amount of time to wait for a condition evaluated by [com.github.epadronu.balin.core.WaitingSupport.waitFor] to hold.34 * @constructor Creates a new configuration setup builder.35 */36open class ConfigurationSetupBuilder {37 var autoQuit: Boolean = ConfigurationSetup.Default.autoQuit38 var driverFactory: () -> WebDriver = ConfigurationSetup.Default.driverFactory39 var waitForSleepTimeInMilliseconds: Long = ConfigurationSetup.Default.waitForSleepTimeInMilliseconds40 var waitForTimeOutTimeInSeconds: Long = ConfigurationSetup.Default.waitForTimeOutTimeInSeconds41 /**42 * Creates a new configuration setup.43 *44 * @return a new configuration setup using the options provided to the builder.45 */...
SearchResultPage.kt
Source:SearchResultPage.kt
...16/* ***************************************************************************/17package pages18/* ***************************************************************************/19/* ***************************************************************************/20import com.github.epadronu.balin.core.Browser21import com.github.epadronu.balin.core.Page22import com.github.epadronu.balin.extensions.`$`23import components.SearchBar24import utils.presenceOfElementLocated25import org.openqa.selenium.By26import org.openqa.selenium.support.ui.ExpectedConditions.numberOfElementsToBeMoreThan27/* ***************************************************************************/28/* ***************************************************************************/29class SearchResultPage(browser: Browser) : Page(browser) {30 companion object {31 private const val REPO_LIST_ITEM_LINKS_SELECTOR = "//*[contains(@class, 'repo-list-item')]//h3//a"32 private const val SEARCH_INPUT_SELECTOR = "input[placeholder='Search GitHub']"33 }34 override val at = at {35 waitFor {36 presenceOfElementLocated(By.className("codesearch-results"))37 }38 }39 val searchBar by lazy {40 `$`(SEARCH_INPUT_SELECTOR, 0).component(::SearchBar)41 }42 private val repoListItemLinks43 get() = waitFor {...
Utils.kt
Source:Utils.kt
...16/* ***************************************************************************/17package utils18/* ***************************************************************************/19/* ***************************************************************************/20import com.github.epadronu.balin.core.Browser21import com.github.epadronu.balin.core.Page22import com.github.epadronu.balin.core.withWindow23import org.openqa.selenium.By24import org.openqa.selenium.support.ui.ExpectedCondition25import kotlin.reflect.KProperty26import kotlin.reflect.full.primaryConstructor27/* ***************************************************************************/28/* ***************************************************************************/29fun presenceOfElementLocated(by: By) = ExpectedCondition { webDriver ->30 webDriver?.findElement(by)?.isDisplayed ?: false31}32class ThreadLocalDelegate<T>(private val delegate: ThreadLocal<T> = ThreadLocal<T>()) {33 constructor(initialValueSupplier: () -> T) : this(ThreadLocal.withInitial(initialValueSupplier))34 operator fun getValue(thisRef: Any?, property: KProperty<*>): T = delegate.get()35 operator fun setValue(thisRef: Any?, property: KProperty<*>, value: T): Unit = delegate.set(value)36}37// Should be part of Balin very soon38inline fun <reified T : Page> T.withWindow(nameOrHandle: String? = null, windowContext: T.() -> Unit) {39 this.browser.withWindow(nameOrHandle) {40 @Suppress("UNCHECKED_CAST")41 windowContext(this@withWindow.browser.at(T::class.primaryConstructor as (Browser) -> T))42 }43}44/* ***************************************************************************/...
HomePage.kt
Source:HomePage.kt
...16/* ***************************************************************************/17package pages18/* ***************************************************************************/19/* ***************************************************************************/20import com.github.epadronu.balin.core.Browser21import com.github.epadronu.balin.core.Page22import com.github.epadronu.balin.extensions.`$`23import components.SearchBar24/* ***************************************************************************/25/* ***************************************************************************/26class HomePage(browser: Browser) : Page(browser) {27 companion object {28 private const val SEARCH_INPUT_SELECTOR = "input[placeholder='Search GitHub']"29 }30 override val url = "https://github.com/"31 override val at = at {32 assert(title == "The worldâs leading software development platform · GitHub") {33 "The actual title was `$title`"34 }35 }36 val searchBar by lazy {37 `$`(SEARCH_INPUT_SELECTOR, 0).component(::SearchBar)38 }39}40/* ***************************************************************************/...
SearchBar.kt
Source:SearchBar.kt
1/******************************************************************************2 * Copyright 2016 Edinson E. Padrón Urdaneta3 *4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 *8 * http://www.apache.org/licenses/LICENSE-2.09 *10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 *****************************************************************************/16/* ***************************************************************************/17package components18/* ***************************************************************************/19/* ***************************************************************************/20import com.github.epadronu.balin.core.Component21import com.github.epadronu.balin.core.Page22import pages.SearchResultPage23import org.openqa.selenium.Keys24import org.openqa.selenium.WebElement25import org.openqa.selenium.support.ui.ExpectedConditions26/* ***************************************************************************/27/* ***************************************************************************/28class SearchBar(page: Page, rootElement: WebElement) : Component(page, rootElement) {29 fun search(text: String): SearchResultPage {30 with(rootElement) {31 clear()32 sendKeys(text)33 sendKeys(Keys.RETURN)34 }35 waitFor {36 ExpectedConditions.urlContains(text)37 }38 return browser.at(::SearchResultPage)39 }40}41/* ***************************************************************************/...
RepositoryPage.kt
Source:RepositoryPage.kt
...16/* ***************************************************************************/17package pages18/* ***************************************************************************/19/* ***************************************************************************/20import com.github.epadronu.balin.core.Browser21import com.github.epadronu.balin.core.Page22import org.openqa.selenium.By23import org.openqa.selenium.support.ui.ExpectedConditions.presenceOfElementLocated24/* ***************************************************************************/25/* ***************************************************************************/26class RepositoryPage(browser: Browser) : Page(browser) {27 companion object {28 private const val TITLE = "h1.public"29 }30 val title: String by lazy {31 waitFor {32 presenceOfElementLocated(By.cssSelector(TITLE))33 }.text34 }35}36/* ***************************************************************************/...
DataPages.kt
Source:DataPages.kt
1package dev.ajthom.covid.cdc2import com.github.epadronu.balin.core.Browser3import com.github.epadronu.balin.core.Page4import org.openqa.selenium.By5import org.openqa.selenium.support.ui.ExpectedConditions6abstract class CDCDataPage(browser: Browser, query: String): Page(browser) {7 override val url = "https://covid.cdc.gov/covid-data-tracker/#$query"8 override val at = at {9 title == "CDC COVID Data Tracker"10 }11 private val downloadButton by lazy {12 waitFor {13 ExpectedConditions.elementToBeClickable(By.id("btnUSTrendsTableExport"))14 }15 }16 private val tableHeader by lazy {17 waitFor {18 ExpectedConditions.elementToBeClickable(By.id("us-trends-table-title"))19 }20 }21 fun clickDownload() {22 tableHeader.click()23 downloadButton.click()24 }25}26class TotalCasesPage(browser: Browser): CDCDataPage(browser, "trends_totalcases")27class TotalDeathsPage(browser: Browser): CDCDataPage(browser, "trends_totaldeaths")28class DailyCasesPage(browser: Browser): CDCDataPage(browser, "trends_dailycases")29class DailyDeathsPage(browser: Browser): CDCDataPage(browser, "trends_dailydeaths")30class DailyTestVolumePage(browser: Browser): CDCDataPage(browser, "trends_newtestresultsreported")...
Browser
Using AI Code Generation
1import com.github.epadronu.balin.core.Browser2import com.github.epadronu.balin.core.Browser._3import com.github.epadronu.balin.Browser4import com.github.epadronu.balin.Browser._5import com.github.epadronu.Browser6import com.github.epadronu.Browser._7import com.github.Browser8import com.github.Browser._9import com.Browser10import com.Browser._11import Browser12import Browser._13import _root_.Browser14import _root_.Browser._15import _root_.com.github.epadronu.balin.core.Browser16import _root_.com.github.epadronu.balin.core.Browser._17import _root_.com.github.epadronu.balin.Browser18import _root_.com.github.epadronu.balin.Browser._19import _root_.com.github.epadronu.Browser20import _root_.com.github.epadronu.Browser._21import _root_.com.Browser22import _root_.com.Browser._23import _root_.Browser24import _root_.Browser._25import _root_.com.github.epadronu.balin.core.Browser._26import _root_.com.github.epadronu.balin.core.Browser._27import _root_.com.github.epadronu.balin.Browser._28import _root_.com.github.epadronu.balin.Browser._29import _root_.com.github.epadronu.Browser._30import _root_.com.github.epadronu.Browser._31import
Browser
Using AI Code Generation
1import com.github.epadronu.balin.core.Browser;2import org.openqa.selenium.WebDriver;3import org.openqa.selenium.chrome.ChromeDriver;4import org.openqa.selenium.chrome.ChromeOptions;5import org.openqa.selenium.remote.DesiredCapabilities;6import org.openqa.selenium.remote.RemoteWebDriver;7import java.net.URL;
Browser
Using AI Code Generation
1 Browser browser = new Browser();2 browser.open();3 browser.close();4 Browser browser = new Browser();5 browser.open();6 browser.close();7 Browser browser = new Browser();8 browser.open();9 browser.close();10 Browser browser = new Browser();11 browser.open();12 browser.close();13 Browser browser = new Browser();14 browser.open();15 browser.close();16 Browser browser = new Browser();17 browser.open();18 browser.close();
Browser
Using AI Code Generation
1Browser browser = BrowserFactory.createBrowser();2browser.quit();3Browser browser = BrowserFactory.createBrowser();4browser.quit();5Browser browser = BrowserFactory.createBrowser();6browser.quit();7Browser browser = BrowserFactory.createBrowser();8browser.quit();9Browser browser = BrowserFactory.createBrowser();10browser.quit();11Browser browser = BrowserFactory.createBrowser();12browser.quit();13Browser browser = BrowserFactory.createBrowser();14browser.quit();15Browser browser = BrowserFactory.createBrowser();16browser.quit();17Browser browser = BrowserFactory.createBrowser();18browser.quit();19Browser browser = BrowserFactory.createBrowser();20browser.quit();21Browser browser = BrowserFactory.createBrowser();22browser.quit();23Browser browser = BrowserFactory.createBrowser();24browser.quit();25Browser browser = BrowserFactory.createBrowser();26browser.quit();
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!