How to use startBrowser method in fMBT

Best Python code snippet using fMBT_python

test_01_Checkboxes_Suite.py

Source:test_01_Checkboxes_Suite.py Github

copy

Full Screen

1from selenium import webdriver2from Libraries import configRead3from Pages import Bootstrap_Date_picker4from Pages import jQuery_Date_picker5from Assersions import Forms_Assersions6from Pages import Simple_Form_Demo7from selenium.webdriver.support import expected_conditions as EC8from selenium.webdriver.support.ui import WebDriverWait9from selenium.webdriver.common.by import By10from selenium.webdriver.common.action_chains import ActionChains11from selenium.webdriver.common.keys import Keys12from selenium.webdriver.support.select import Select13import time14import pytest15import datetime16def test_008_TC_checkboxes1_section_heading(startbrowser):17 driver = startbrowser[0]18 wait = startbrowser[1]19 mouseaction = startbrowser[2]20 driver.find_element_by_xpath("//a[contains(text(),'Input Forms')]").click()21 driver.find_element_by_xpath("//a[contains(text(),'Checkbox Demo')]").click()22 #heading = driver.find_element_by_xpath("//div[text()='Single Checkbox Demo']").text23 #assert heading =="Single Checkbox Demo"24def test_009_TC_validate_checkbox1(startbrowser):25 driver = startbrowser[0]26 wait = startbrowser[1]27 mouseaction = startbrowser[2]28 driver.find_element_by_xpath("//input[@id='isAgeSelected']").click()29 #status = driver.find_element_by_xpath("//input[@id='isAgeSelected']").is_enabled()30 #assert status == True31 driver.find_element_by_xpath("//input[@id='isAgeSelected']").click()32def test_010_TC_Multiple_Checkbox_Demo_heading(startbrowser):33 driver = startbrowser[0]34 wait = startbrowser[1]35 mouseaction = startbrowser[2]36 heading = driver.find_element_by_xpath("//div[text()='Multiple Checkbox Demo']").text37 #assert heading =="Multiple Checkbox Demo"38def test_011_TC_Multiple_checkbox_select(startbrowser):39 driver = startbrowser[0]40 wait = startbrowser[1]41 mouseaction = startbrowser[2]42 driver.find_element_by_xpath("//label[text()='Option 1']").click()43 time.sleep(1)44 driver.find_element_by_xpath("//label[text()='Option 2']").click()45 time.sleep(1)46 driver.find_element_by_xpath("//label[text()='Option 3']").click()47 time.sleep(1)48 driver.find_element_by_xpath("//label[text()='Option 4']").click()49 time.sleep(1)50 attvalue = driver.find_element_by_xpath("//input[@id='check1']").get_attribute("value")51 #assert attvalue == "Uncheck All"52def test_012_TC_uncheck_all_checkbox_click(startbrowser):53 driver = startbrowser[0]54 wait = startbrowser[1]55 mouseaction = startbrowser[2]56 driver.find_element_by_xpath("//input[@id='check1']").click()57 checkbox_state = driver.find_element_by_xpath("//input[@id='check1']").get_attribute("value")...

Full Screen

Full Screen

test_02_DataPicker_Suite.py

Source:test_02_DataPicker_Suite.py Github

copy

Full Screen

1from selenium import webdriver2from Libraries import configRead3from Pages import Bootstrap_Date_picker4from Pages import jQuery_Date_picker5from selenium.webdriver.support import expected_conditions as EC6from selenium.webdriver.support.ui import WebDriverWait7from selenium.webdriver.common.by import By8from selenium.webdriver.common.action_chains import ActionChains9from selenium.webdriver.common.keys import Keys10from selenium.webdriver.support.select import Select11import time12import pytest13import datetime14def test_TC_001_bootstrap_date_picker_(startbrowser):15 driver = startbrowser[0]16 wait = startbrowser[1]17 mouseaction = startbrowser[2]18 # Select 31 March of the Last financial Year, irrespective of current date time.19 bootstrap = Bootstrap_Date_picker.bootStrapDate_Picker(driver,mouseaction,wait)20 bootstrap.select_date_picker_menu()21 bootstrap.select_bootstap_menu()22 bootstrap.click_first_date_field()23 bootstrap.month_select()24 bootstrap.date_select()25def test_TC_002_bootstrap_date_range_picker(startbrowser):26 driver = startbrowser[0]27 wait = startbrowser[1]28 mouseaction = startbrowser[2]29 bootstrap = Bootstrap_Date_picker.bootStrapDate_Picker(driver,mouseaction,wait)30 driver.execute_script('window.scrollTo(0, 40)')31 bootstrap.enter_current_date_in_second_field_section1()32 bootstrap.select_second_field_section2()33 bootstrap.clear_second_field_section1_value()34 bootstrap.select_16day_gap_date_value()35def test_TC_003_JQuery_date_range_picker(startbrowser):36 driver = startbrowser[0]37 wait = startbrowser[1]38 mouseaction = startbrowser[2]39 bootstrap = Bootstrap_Date_picker.bootStrapDate_Picker(driver, mouseaction, wait)40 bootstrap.select_date_picker_menu()41 jQuery = jQuery_Date_picker.jQueryClass(driver,mouseaction)42 jQuery.select_jQuery_date_menu()43 jQuery.click_first_date_field()44 jQuery.select_date_in_firstdate_field()45 time.sleep(3)46 driver.find_element_by_xpath("//input[2]").send_keys(jQuery.get_date())...

Full Screen

Full Screen

test_03_Forms_Suite.py

Source:test_03_Forms_Suite.py Github

copy

Full Screen

1from selenium import webdriver2from Libraries import configRead3from Assersions import Forms_Assersions4from Pages import Simple_Form_Demo5from selenium.webdriver.support import expected_conditions as EC6from selenium.webdriver.support.ui import WebDriverWait7from selenium.webdriver.common.by import By8from selenium.webdriver.common.action_chains import ActionChains9from selenium.webdriver.common.keys import Keys10from selenium.webdriver.support.select import Select11import time12import pytest13import datetime14def test_TC_004_title_Simple_Form_One(startbrowser):15 driver = startbrowser[0]16 wait = startbrowser[1]17 mouseaction = startbrowser[2]18 SimpleForm = Simple_Form_Demo.simpleformClass(driver)19 SimpleForm.input_form_link_click()20 SimpleForm.simple_form__demo_link_click()21 title = SimpleForm.get_form_1_title()22 Forms_Assersions.assert_title_form_1(title)23def test_TC_005_Sigle_input_field_check(startbrowser):24 driver = startbrowser[0]25 wait = startbrowser[1]26 mouseaction = startbrowser[2]27 driver.find_element_by_xpath("//input[@id='user-message']").send_keys("Aashish")28 driver.find_element_by_xpath("//button[contains(text(),'Show Message')]").click()29 entredtext = driver.find_element_by_xpath("//div[@id='user-message']/span").text30 assert entredtext == "Aashish"31def test_TC_006_title_sample_form2(startbrowser):32 driver = startbrowser[0]33 wait = startbrowser[1]34 mouseaction = startbrowser[2]35 sample = Simple_Form_Demo.simpleformClass(driver)36 title = sample.get_form2_title()37 Forms_Assersions.assert_title_form_2(title)38def test_TC_007_Double_input_field_check(startbrowser):39 driver = startbrowser[0]40 wait = startbrowser[1]41 mouseaction = startbrowser[2]42 sample = Simple_Form_Demo.simpleformClass(driver)43 sample.enter_form2_field1_value("5")44 sample.enter_form2_field2_value("10")45 sample.click__form2_get_result_button()46 result = sample.check_form2_result()...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run fMBT automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful