mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2026-01-10 14:21:30 +00:00
Perfecto Mobile Device TestCases
This commit is contained in:
112
libs/perfecto/android/ToggleAirplaneModeAndroid.py
Normal file
112
libs/perfecto/android/ToggleAirplaneModeAndroid.py
Normal file
@@ -0,0 +1,112 @@
|
||||
import time
|
||||
import unittest
|
||||
import warnings
|
||||
|
||||
#from perfecto import TestResultFactory
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.webdriver.common.by import By
|
||||
import argparse
|
||||
from BaseClassAndroid import TestConf
|
||||
|
||||
|
||||
class ReportingTests(TestConf):
|
||||
|
||||
def test_navigation(self):
|
||||
warnings.simplefilter("ignore", ResourceWarning)
|
||||
try:
|
||||
# assert 'Perfecto' in self.driver.title
|
||||
print("-------------------------------------------")
|
||||
#REPORTIUM TEST START
|
||||
#self.reporting_client.step_start("BasicConnectionTest")
|
||||
|
||||
#Open Setting Application
|
||||
print("Opening Settings App..")
|
||||
params = {'identifier': 'com.android.settings'}
|
||||
self.driver.execute_script('mobile:application:close', params)
|
||||
self.driver.execute_script('mobile:application:open', params)
|
||||
|
||||
print("Load Wifi/BlueTooth/AirplaneMode Connection Settings..")
|
||||
element = self.driver.find_element_by_xpath("//*[@text='Connections']")
|
||||
element.click()
|
||||
|
||||
#Verifies if AP is connected to Wifi status
|
||||
# print("Verify AirplaneMode Connection Status..")
|
||||
# try:
|
||||
# WifiXpath = "//*[@text='Airplane mode']/parent::*/android.widget.TextView[2]"
|
||||
## elementWifName = self.driver.find_element_by_xpath(WifiXpath)
|
||||
# print("Airplane Mode StatusMsg: " + elementWifName.text)
|
||||
# except NoSuchElementException:
|
||||
# print("Exception: Unable to Toggle Airplane Radio Button...Check Xpath")
|
||||
|
||||
|
||||
print("Toggle Airplane AP Mode..")
|
||||
try:
|
||||
WifiInternet = self.driver.find_element_by_xpath("//*[@content-desc='Airplane mode']")
|
||||
WifiInternet.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception: Unable to Toggle Airplane Radio Button...Check Xpath")
|
||||
|
||||
|
||||
#Ensure Wifi Radio Button Disabled
|
||||
print("Verify Airplane Disconnected Status..")
|
||||
try:
|
||||
WifiXpathDisconnected = "//*[@text='Airplane mode']/parent::*/android.widget.TextView[2]"
|
||||
elementWifiDiscont = self.driver.find_element_by_xpath(WifiXpathDisconnected)
|
||||
print("AirPlane Disconnected Name: " + "Please " + elementWifiDiscont.text)
|
||||
except NoSuchElementException:
|
||||
print("Warning...No Airplane Mode Msg...Check Xpath")
|
||||
|
||||
print("Toggle Airplane Radio Button On..")
|
||||
try:
|
||||
#Toggle Wifi Radio Button
|
||||
WifiInternet2 = self.driver.find_element_by_xpath("//*[@content-desc='Airplane mode']")
|
||||
WifiInternet2.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception: Unable to Toggle Airplane Radio...Check Xpath")
|
||||
|
||||
#Verifies if AP is connected to Wifi status
|
||||
print("Verify Wifi ReConnection Status..")
|
||||
try:
|
||||
WifiXpathToggle = "//*[@text='Wi-Fi']/parent::*/android.widget.TextView[2]"
|
||||
elementWifNameToggle = self.driver.find_element_by_xpath(WifiXpathToggle)
|
||||
print("Wifi Connected AP Status: " + elementWifNameToggle.text)
|
||||
#self.assertEqual("elementWifName.text","elementWifNameToggle.text","Connection Successfull Reconnected")
|
||||
print("Connection Successfull Reconnected")
|
||||
except NoSuchElementException:
|
||||
print("Exception: AirplaneMode Not Connected Back...Check Xpath")
|
||||
|
||||
except NoSuchElementException as ex:
|
||||
self.currentResult = False
|
||||
#self.reporting_client.test_stop(TestResultFactory.create_failure("NoSuchElementException", ex))
|
||||
print (ex.message)
|
||||
self.currentResult = True
|
||||
#self.reporting_client.test_stop(Tes
|
||||
|
||||
if __name__ == '__main__':
|
||||
# parser = argparse.ArgumentParser(description="Perfecto Arguments")
|
||||
|
||||
#parser.add_argument(
|
||||
# "-c",
|
||||
# "--cloud_name",
|
||||
# metavar="cloud_name",
|
||||
# help="Perfecto cloud name. (E.g. demo)",
|
||||
#)
|
||||
# parser.add_argument(
|
||||
# "-s",
|
||||
# "--security_token",
|
||||
# metavar="security_token",
|
||||
# help="Perfecto cloud name. (E.g. demo)",
|
||||
# )
|
||||
|
||||
#args = vars(parser.parse_args())
|
||||
|
||||
#if not args["cloud_name"]:
|
||||
# parser.print_help()
|
||||
# parser.error(
|
||||
# "cloud_name parameter is empty. Pass the argument -c followed by cloud_name"
|
||||
# )
|
||||
# exit
|
||||
|
||||
#print(str(args["cloud_name"]))
|
||||
|
||||
unittest.main()
|
||||
114
libs/perfecto/android/ToggleWifiModeAndroid.py
Normal file
114
libs/perfecto/android/ToggleWifiModeAndroid.py
Normal file
@@ -0,0 +1,114 @@
|
||||
import time
|
||||
import unittest
|
||||
import warnings
|
||||
|
||||
#from perfecto import TestResultFactory
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.webdriver.common.by import By
|
||||
import argparse
|
||||
from BaseClassAndroid import TestConf
|
||||
|
||||
|
||||
class ReportingTests(TestConf):
|
||||
|
||||
def test_navigation(self):
|
||||
warnings.simplefilter("ignore", ResourceWarning)
|
||||
try:
|
||||
# assert 'Perfecto' in self.driver.title
|
||||
print("-------------------------------------------")
|
||||
#REPORTIUM TEST START
|
||||
#self.reporting_client.step_start("BasicConnectionTest")
|
||||
|
||||
#Open Setting Application
|
||||
print("Opening Settings App..")
|
||||
params = {'identifier': 'com.android.settings'}
|
||||
self.driver.execute_script('mobile:application:close', params)
|
||||
self.driver.execute_script('mobile:application:open', params)
|
||||
|
||||
|
||||
print("Load Wifi/BlueTooth/AirplaneMode Connection Settings..")
|
||||
element = self.driver.find_element_by_xpath("//*[@text='Connections']")
|
||||
element.click()
|
||||
|
||||
|
||||
#Verifies if AP is connected to Wifi status
|
||||
print("Verify Wifi Connection Status..")
|
||||
try:
|
||||
WifiXpath = "//*[@text='Wi-Fi']/parent::*/android.widget.TextView[2]"
|
||||
elementWifName = self.driver.find_element_by_xpath(WifiXpath)
|
||||
print("Wifi Connected AP Name: " + elementWifName.text)
|
||||
except NoSuchElementException:
|
||||
print("Exception: Unable to Toggle Wifi Radio Button...Check Xpath")
|
||||
|
||||
|
||||
print("Toggle Wifi AP Mode..")
|
||||
try:
|
||||
WifiInternet = self.driver.find_element_by_xpath("//*[@content-desc='Wi-Fi']")
|
||||
WifiInternet.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception: Unable to Toggle Wifi Radio Button...Check Xpath")
|
||||
|
||||
|
||||
#Ensure Wifi Radio Button Disabled
|
||||
print("Verify Wifi Disconnected Status..")
|
||||
try:
|
||||
WifiXpathDisconnected = "//*[@text='Wi-Fi']/parent::*/android.widget.TextView[2]"
|
||||
elementWifiDiscont = self.driver.find_element_by_xpath(WifiXpathDisconnected)
|
||||
print("Wifi Disconnected Name: " + "Please " + elementWifiDiscont.text)
|
||||
except NoSuchElementException:
|
||||
print("Warning...No Wifi Disconnected Msg...Check Xpath")
|
||||
|
||||
print("Toggle Wifi Radio Button On..")
|
||||
try:
|
||||
#Toggle Wifi Radio Button
|
||||
WifiInternet2 = self.driver.find_element_by_xpath("//*[@content-desc='Wi-Fi']")
|
||||
WifiInternet2.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception: Unable to Toggle Wifi Radio...Check Xpath")
|
||||
|
||||
#Verifies if AP is connected to Wifi status
|
||||
print("Verify Wifi ReConnection Status..")
|
||||
try:
|
||||
WifiXpathToggle = "//*[@text='Wi-Fi']/parent::*/android.widget.TextView[2]"
|
||||
elementWifNameToggle = self.driver.find_element_by_xpath(WifiXpathToggle)
|
||||
print("Wifi Connected AP Status: " + elementWifNameToggle.text)
|
||||
#self.assertEqual("elementWifName.text","elementWifNameToggle.text","Connection Successfull Reconnected")
|
||||
print("Connection Successfull Reconnected")
|
||||
except NoSuchElementException:
|
||||
print("Exception: Wifi Not Connected Back.Check Xpath")
|
||||
|
||||
except NoSuchElementException as ex:
|
||||
self.currentResult = False
|
||||
#self.reporting_client.test_stop(TestResultFactory.create_failure("NoSuchElementException", ex))
|
||||
print (ex.message)
|
||||
self.currentResult = True
|
||||
#self.reporting_client.test_stop(Tes
|
||||
|
||||
if __name__ == '__main__':
|
||||
# parser = argparse.ArgumentParser(description="Perfecto Arguments")
|
||||
|
||||
#parser.add_argument(
|
||||
# "-c",
|
||||
# "--cloud_name",
|
||||
# metavar="cloud_name",
|
||||
# help="Perfecto cloud name. (E.g. demo)",
|
||||
#)
|
||||
# parser.add_argument(
|
||||
# "-s",
|
||||
# "--security_token",
|
||||
# metavar="security_token",
|
||||
# help="Perfecto cloud name. (E.g. demo)",
|
||||
# )
|
||||
|
||||
#args = vars(parser.parse_args())
|
||||
|
||||
#if not args["cloud_name"]:
|
||||
# parser.print_help()
|
||||
# parser.error(
|
||||
# "cloud_name parameter is empty. Pass the argument -c followed by cloud_name"
|
||||
# )
|
||||
# exit
|
||||
|
||||
#print(str(args["cloud_name"]))
|
||||
|
||||
unittest.main()
|
||||
165
libs/perfecto/iOS/ToggleAirplaneModeiOS.py
Normal file
165
libs/perfecto/iOS/ToggleAirplaneModeiOS.py
Normal file
@@ -0,0 +1,165 @@
|
||||
import time
|
||||
import unittest
|
||||
import warnings
|
||||
|
||||
#from perfecto import TestResultFactory
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.webdriver.common.by import By
|
||||
import argparse
|
||||
from BaseClassiOS import TestConf
|
||||
|
||||
|
||||
class ReportingTests(TestConf):
|
||||
|
||||
def test_navigation(self):
|
||||
warnings.simplefilter("ignore", ResourceWarning)
|
||||
try:
|
||||
# assert 'Perfecto' in self.driver.title
|
||||
print("-------------------------------------------")
|
||||
#REPORTIUM TEST START
|
||||
#self.reporting_client.step_start("BasicConnectionTest")
|
||||
#DefaultGateWayAccessPoint = self.driver.find_element_by_xpath("//*[@label='Default Gateway IP']/parent::*/XCUIElementTypeButton").text
|
||||
# print("Device-DefaultGateWay-AP: " + "'"+ DefaultGateWayAccessPoint + "'")
|
||||
#self.assertNotEqual(DefaultGateWayAccessPoint, "N/A", "Check Wifi Access Point")
|
||||
print("Verify Internet Connection..")
|
||||
networkAccessPoint = self.driver.find_element_by_xpath("//*[@label='Network Connected']/parent::*/XCUIElementTypeButton").text
|
||||
print("Network-AccessPoint-Connected: " + "'"+ networkAccessPoint + "'")
|
||||
|
||||
#Open Setting Application
|
||||
print("Opening Settings App..")
|
||||
params = {'identifier': 'com.apple.Preferences'}
|
||||
self.driver.execute_script('mobile:application:open', params)
|
||||
self.driver.execute_script('mobile:application:close', params)
|
||||
self.driver.execute_script('mobile:application:open', params)
|
||||
|
||||
print("Verify Wifi Connection Name..")
|
||||
element = self.driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
|
||||
Wifi_AP_Name = element.text
|
||||
print("Wifi_AP_ConnName: " + "'"+ Wifi_AP_Name + "'")
|
||||
|
||||
#Verify if Ap is connected with Wifi
|
||||
print("Click Wifi Connection..")
|
||||
element.click()
|
||||
|
||||
#Verifies if AP is connected to Wifi status
|
||||
print("Verify Wifi Connection Status..")
|
||||
WifiXpath = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ Wifi_AP_Name + "']"
|
||||
elementWifName = self.driver.find_element_by_xpath(WifiXpath)
|
||||
|
||||
#Check AP Internet Error Msg
|
||||
print("Checking Internet Connection Error..")
|
||||
# self.driver.implicitly_wait(5)
|
||||
try:
|
||||
WifiInternetErrMsg = self.driver.find_element_by_xpath("//*[@label='No Internet Connection']").text
|
||||
except NoSuchElementException:
|
||||
print("Connected-Wifi-AP..Connection Successfull")
|
||||
|
||||
#Close/Open App resets the settings app back to home page
|
||||
self.driver.execute_script('mobile:application:close', params)
|
||||
self.driver.execute_script('mobile:application:open', params)
|
||||
|
||||
#Toggle Airplane Mode
|
||||
print("Toggle Airplane Mode..")
|
||||
try:
|
||||
AirplaneMode = self.driver.find_element_by_xpath("//XCUIElementTypeSwitch[@label='Airplane Mode']")
|
||||
#Toggle Airplane Mode
|
||||
AirplaneMode.click()
|
||||
|
||||
#Verify Cellular Mode Text
|
||||
try:
|
||||
CellularMsgEle = self.driver.find_element_by_xpath("//*[@name='Airplane Mode' and @value='Airplane Mode']")
|
||||
self.assertEqual(CellularMsgEle.text, "Airplane Mode", "Airplane Mode Not Triggerd")
|
||||
print("Verify Cellular Mode Text: Airplane Mode Success")
|
||||
except NoSuchElementException:
|
||||
print("Exception Cellular Mode Not in Airplane Mode: CheckPhoneStatus")
|
||||
|
||||
#Set Airplane Mode Back
|
||||
AirplaneMode.click()
|
||||
except NoSuchElementException:
|
||||
print("Airplane Wifi Button not loaded...")
|
||||
|
||||
#Verify No Sim Card Installed Msg Popup
|
||||
print("Verify No Sim Card Installed Msg Popup..")
|
||||
try:
|
||||
NoSimCardErrorMsg = self.driver.find_element_by_xpath("//*[@value='No SIM Card Installed']")
|
||||
except NoSuchElementException:
|
||||
print(" ----- No Sim Card AlertMsg ----")
|
||||
|
||||
#Click ok on No Sim Card Msg Popup
|
||||
print("Click ok on No Sim Card Msg Popup..")
|
||||
try:
|
||||
NoSimCardErrorMsgOK = self.driver.find_element_by_xpath("//*[@label='OK']")
|
||||
NoSimCardErrorMsgOK.click()
|
||||
except NoSuchElementException:
|
||||
print(" ----- No Sim Card AlertMsg -----")
|
||||
|
||||
#Close/Open App resets the settings app back to home page
|
||||
self.driver.execute_script('mobile:application:close', params)
|
||||
self.driver.execute_script('mobile:application:open', params)
|
||||
|
||||
#time.sleep(5)
|
||||
print("Verify Wifi Connection Name after Airplane Toggle Mode..")
|
||||
element22 = self.driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
|
||||
Wifi_AP_NameNew = element22.text
|
||||
print("Wifi_AP_ConnNameAfterToggle: " + "'"+ Wifi_AP_NameNew + "'")
|
||||
|
||||
#self.assertqual(Wifi_AP_Name, "Sendto: No route to host", "Packet Loss Exist, Please Check Device AP: " + Wifi_AP_Name)
|
||||
#self.assertEqual(Wifi_AP_Name, Wifi_AP_NameNew, "AP Connection Successfull")
|
||||
|
||||
#Verify if Ap is connected with Wifi
|
||||
print("Click Wifi Connection after Airplane Toggle Mode..")
|
||||
element22.click()
|
||||
|
||||
#Verifies if AP is connected to Wifi status
|
||||
print("Verify Wifi Connection Status..")
|
||||
WifiXpath = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ Wifi_AP_Name + "']"
|
||||
elementWifName = self.driver.find_element_by_xpath(WifiXpath)
|
||||
|
||||
#Check AP Internet Error Msg
|
||||
print("Checking Internet Connection Error..")
|
||||
# self.driver.implicitly_wait(5)
|
||||
try:
|
||||
WifiInternetErrMsg = self.driver.find_element_by_xpath("//*[@label='No Internet Connection']").text
|
||||
except NoSuchElementException:
|
||||
print("Connected-Wifi-AP..Connection Successfull")
|
||||
|
||||
|
||||
#Close Settings App
|
||||
print("Close Settings App")
|
||||
self.driver.execute_script('mobile:application:close', params)
|
||||
|
||||
except NoSuchElementException as ex:
|
||||
self.currentResult = False
|
||||
#self.reporting_client.test_stop(TestResultFactory.create_failure("NoSuchElementException", ex))
|
||||
print (ex.message)
|
||||
self.currentResult = True
|
||||
#self.reporting_client.test_stop(Tes
|
||||
|
||||
if __name__ == '__main__':
|
||||
# parser = argparse.ArgumentParser(description="Perfecto Arguments")
|
||||
|
||||
#parser.add_argument(
|
||||
# "-c",
|
||||
# "--cloud_name",
|
||||
# metavar="cloud_name",
|
||||
# help="Perfecto cloud name. (E.g. demo)",
|
||||
#)
|
||||
# parser.add_argument(
|
||||
# "-s",
|
||||
# "--security_token",
|
||||
# metavar="security_token",
|
||||
# help="Perfecto cloud name. (E.g. demo)",
|
||||
# )
|
||||
|
||||
#args = vars(parser.parse_args())
|
||||
|
||||
#if not args["cloud_name"]:
|
||||
# parser.print_help()
|
||||
# parser.error(
|
||||
# "cloud_name parameter is empty. Pass the argument -c followed by cloud_name"
|
||||
# )
|
||||
# exit
|
||||
|
||||
#print(str(args["cloud_name"]))
|
||||
|
||||
unittest.main()
|
||||
131
libs/perfecto/iOS/ToggleWifiModeiOS.py
Normal file
131
libs/perfecto/iOS/ToggleWifiModeiOS.py
Normal file
@@ -0,0 +1,131 @@
|
||||
import time
|
||||
import unittest
|
||||
import warnings
|
||||
|
||||
#from perfecto import TestResultFactory
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.webdriver.common.by import By
|
||||
import argparse
|
||||
from BaseClassiOS import TestConf
|
||||
|
||||
|
||||
class ReportingTests(TestConf):
|
||||
|
||||
def test_navigation(self):
|
||||
warnings.simplefilter("ignore", ResourceWarning)
|
||||
try:
|
||||
# assert 'Perfecto' in self.driver.title
|
||||
print("-------------------------------------------")
|
||||
#REPORTIUM TEST START
|
||||
#self.reporting_client.step_start("BasicConnectionTest")
|
||||
#DefaultGateWayAccessPoint = self.driver.find_element_by_xpath("//*[@label='Default Gateway IP']/parent::*/XCUIElementTypeButton").text
|
||||
# print("Device-DefaultGateWay-AP: " + "'"+ DefaultGateWayAccessPoint + "'")
|
||||
#self.assertNotEqual(DefaultGateWayAccessPoint, "N/A", "Check Wifi Access Point")
|
||||
print("Verify Internet Connection..")
|
||||
networkAccessPoint = self.driver.find_element_by_xpath("//*[@label='Network Connected']/parent::*/XCUIElementTypeButton").text
|
||||
print("Network-AccessPoint-Connected: " + "'"+ networkAccessPoint + "'")
|
||||
|
||||
#Open Setting Application - Resets to Home
|
||||
print("Opening Settings App..")
|
||||
params = {'identifier': 'com.apple.Preferences'}
|
||||
self.driver.execute_script('mobile:application:open', params)
|
||||
self.driver.execute_script('mobile:application:close', params)
|
||||
self.driver.execute_script('mobile:application:open', params)
|
||||
|
||||
print("Verify Wifi Connection Name..")
|
||||
element = self.driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
|
||||
Wifi_AP_Name = element.text
|
||||
print("Wifi_AP_ConnName: " + "'"+ Wifi_AP_Name + "'")
|
||||
|
||||
#Verify if Ap is connected with Wifi
|
||||
print("Click Wifi Connection..")
|
||||
element.click()
|
||||
|
||||
#Verifies if AP is connected to Wifi status
|
||||
print("Verify Wifi Connection Status..")
|
||||
WifiXpath = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ Wifi_AP_Name + "']"
|
||||
elementWifName = self.driver.find_element_by_xpath(WifiXpath)
|
||||
|
||||
#Check AP Internet Error Msg
|
||||
print("Checking Internet Connection Error..")
|
||||
# self.driver.implicitly_wait(5)
|
||||
try:
|
||||
WifiInternetErrMsg = self.driver.find_element_by_xpath("//*[@label='No Internet Connection']").text
|
||||
except NoSuchElementException:
|
||||
print("Connected-Wifi-AP..Connection Successfull")
|
||||
|
||||
#Close/Open App resets the settings app back to home page
|
||||
#self.driver.execute_script('mobile:application:close', params)
|
||||
#self.driver.execute_script('mobile:application:open', params)
|
||||
|
||||
#Toggle Wifi Mode
|
||||
print("Toggle Wifi Mode..")
|
||||
try:
|
||||
WifiMode = self.driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='1']")
|
||||
#Toggle Wifi Mode
|
||||
WifiMode.click()
|
||||
#Verify Radio Button Mode
|
||||
try:
|
||||
WifiDissconnected = self.driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='0']")
|
||||
#self.assertEqual(WifiDissconnected.text, "Airplane Mode", "Airplane Mode Not Triggerd")
|
||||
print("Wifi Radio Button Disconnected Successfully")
|
||||
except NoSuchElementException:
|
||||
print("Wifi Radio Button Not Disabled...")
|
||||
|
||||
#Set Airplane Mode Back
|
||||
WifiDissconnected.click()
|
||||
except NoSuchElementException:
|
||||
print("Airplane Wifi Button not loaded...")
|
||||
|
||||
#Verifies if AP is connected to Wifi status
|
||||
print("Verify Wifi Connection Status..")
|
||||
WifiXpath = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ Wifi_AP_Name + "']"
|
||||
elementWifName = self.driver.find_element_by_xpath(WifiXpath)
|
||||
|
||||
#Check AP Internet Error Msg
|
||||
print("Checking Internet Connection Error..")
|
||||
# self.driver.implicitly_wait(5)
|
||||
try:
|
||||
WifiInternetErrMsg = self.driver.find_element_by_xpath("//*[@label='No Internet Connection']").text
|
||||
except NoSuchElementException:
|
||||
print("Connected-Wifi-AP..Connection Successfull")
|
||||
|
||||
#Close Settings App
|
||||
print("Close Settings App")
|
||||
self.driver.execute_script('mobile:application:close', params)
|
||||
|
||||
except NoSuchElementException as ex:
|
||||
self.currentResult = False
|
||||
#self.reporting_client.test_stop(TestResultFactory.create_failure("NoSuchElementException", ex))
|
||||
print (ex.message)
|
||||
self.currentResult = True
|
||||
#self.reporting_client.test_stop(Tes
|
||||
|
||||
if __name__ == '__main__':
|
||||
# parser = argparse.ArgumentParser(description="Perfecto Arguments")
|
||||
|
||||
#parser.add_argument(
|
||||
# "-c",
|
||||
# "--cloud_name",
|
||||
# metavar="cloud_name",
|
||||
# help="Perfecto cloud name. (E.g. demo)",
|
||||
#)
|
||||
# parser.add_argument(
|
||||
# "-s",
|
||||
# "--security_token",
|
||||
# metavar="security_token",
|
||||
# help="Perfecto cloud name. (E.g. demo)",
|
||||
# )
|
||||
|
||||
#args = vars(parser.parse_args())
|
||||
|
||||
#if not args["cloud_name"]:
|
||||
# parser.print_help()
|
||||
# parser.error(
|
||||
# "cloud_name parameter is empty. Pass the argument -c followed by cloud_name"
|
||||
# )
|
||||
# exit
|
||||
|
||||
#print(str(args["cloud_name"]))
|
||||
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user