Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wp-ulike domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/illphate/public_html/wp-includes/functions.php on line 6131

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the astra domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/illphate/public_html/wp-includes/functions.php on line 6131

Deprecated: Function WP_Dependencies->add_data() was called with an argument that is deprecated since version 6.9.0! IE conditional comments are ignored by all supported browsers. in /home/illphate/public_html/wp-includes/functions.php on line 6131
BROWSERSTACK WORKING Test.py | Illphated Dot COM

ILLPHATED dot COM

 
 

BROWSERSTACK WORKING test.py

NORDVPN_ILLPHATED
SHARE THIS NOW!

illphated

import json
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.chrome.options import Options as ChromeOptions

# The webdriver management will be handled by the browserstack-sdk
# so this will be overridden and tests will run browserstack –
# without any changes to the test files!
options = ChromeOptions()
options.set_capability(‘sessionName’, ‘BStack Sample Test’)
driver = webdriver.Chrome(options=options)

NORDVPN_ILLPHATED

try:
driver.get(‘https://illphated.com/’)
WebDriverWait(driver, 10).until(EC.title_contains(‘StackDemo’))
# Get text of an product – iPhone 12
item_on_page = WebDriverWait(driver, 10).until(
EC.visibility_of_element_located((By.XPATH, ‘//*[@id=”1″]/p’))).text
# Click the ‘Add to cart’ button if it is visible
WebDriverWait(driver, 10).until(EC.visibility_of_element_located(
(By.XPATH, ‘//*[@id=”1″]/div[4]’))).click()
# Check if the Cart pane is visible
WebDriverWait(driver, 10).until(EC.visibility_of_element_located(
(By.CLASS_NAME, ‘float-cart__content’)))
# Get text of product in cart
item_in_cart = WebDriverWait(driver, 10).until(EC.visibility_of_element_located(
(By.XPATH, ‘//*[@id=”__next”]/div/div/div[2]/div[2]/div[2]/div/div[3]/p[1]’))).text
# Verify whether the product (iPhone 12) is added to cart
if item_on_page == item_in_cart:
# Set the status of test as ‘passed’ if item is added to cart
driver.execute_script(
‘browserstack_executor: {“action”: “setSessionStatus”, “arguments”: {“status”:”passed”, “reason”: “iPhone 12 has been successfully added to the cart!”}}’)
else:
# Set the status of test as ‘failed’ if item is not added to cart
driver.execute_script(
‘browserstack_executor: {“action”: “setSessionStatus”, “arguments”: {“status”:”failed”, “reason”: “iPhone 12 not added to the cart!”}}’)
except NoSuchElementException as err:
message = ‘Exception: ‘ + str(err.__class__) + str(err.msg)
driver.execute_script(
‘browserstack_executor: {“action”: “setSessionStatus”, “arguments”: {“status”:”failed”, “reason”: ‘ + json.dumps(message) + ‘}}’)
except Exception as err:
message = ‘Exception: ‘ + str(err.__class__) + str(err.msg)
driver.execute_script(
‘browserstack_executor: {“action”: “setSessionStatus”, “arguments”: {“status”:”failed”, “reason”: ‘ + json.dumps(message) + ‘}}’)
finally:
# Stop the driver
driver.quit()

EmailURL
Scroll to Top

Notice: ob_end_flush(): failed to send buffer of zlib output compression (0) in /home/illphate/public_html/wp-includes/functions.php on line 5481