Пример #1
0
def ppysmsql_verify_total_count(attribute_value):
    """
    This function verifies if the object (total device count and total event count) is present on screen

    Function Owner : Abdul_G_Shaik

    Date created : 06/15/2016

    @param attribute_value : (string) Attribute value fetched from Database

    @return flag : (bool) status of execution.if successful True else False
    """
    flag = True
    try:
        'Verify Attribute value exists on screen'
        if g.platform == 'ios':
            element = g.driver.find_element_by_name(
                "com.dell.omm:id/device_count").find_element_by_name(
                    "com.dell.omm:id/device_count")
            #print "Element with name %s is found\n" % (str(attribute_value))
            #control_value = element.get_attribute('value')
            #print 'Control Value:' + str(control_value)
        else:
            #element = g.driver.find_element_by_id("com.dell.omm:id/device_count")

            Try_demomode_lbl = ui_controls.text_view(
                get_obj_identifier('dvce_cnt'))
            print Try_demomode_lbl

            #print "Element with name %s is  found\n" % (str(attribute_value))
            control_value = Try_demomode_lbl
            print 'Control Value:' + str(control_value)

        'Check control value matches attribute value'
        if control_value.strip() == attribute_value.strip():
            print "Control value %s is same as attribute value %s \n" % (
                control_value, attribute_value)
            flag = True
        else:
            print "Control value %s is not same as attribute value %s \n" % (
                control_value, attribute_value)
            flag = False

    except:
        print "Element with name %s not found\n" % (str(attribute_value))
        traceback.print_exc()
        flag = False
    return flag
Пример #2
0
def aadd_ome_wizard():
    """
    This function is used for clicking idrac button

    Function Owner : Sudhish_Singh

    Date created : 

    @return status : (bool)status of execution.if successful True else False
    @return msg : (string) step message in case of exception
    """
    msg, status = "", True

    try:
        'Click on Plus button to launch Add OME wizard'
        time.sleep(5)
        ui_controls.Click(get_obj_identifier('ome_add_btn'))
        print 'plus button clicked Successfully'

        'Check for the existence of Add OME text'
        text_heading = ui_controls.text_view(get_obj_identifier('add_txt'))
        print "Current text value is==>"+str(text_heading)

        'To check if it is returning empty value here'
        if not text_heading:
            print "Add OME text does not exist and it is returning empty value."
            return False, msg

        'Comparing text retrieved from UI with Add OME text'
        if "Add".strip() == text_heading.strip():
            print ("Add OME text has been found!!!")
        else:
            print("Sorry!!!text has been mismatched,it should be Add OME")
            return False, msg

    except Exception as excp:
        traceback.print_exc()
        msg += str(excp)
        status = False
    return status, msg
Пример #3
0
def element_textvalidation(objectidentifier, validationtext):
    """
    This function is used to validate text returned by an ui element for test case validation purpose.

    Function Owner : Sudhish_Singh

    Date created : 

    @return status : (bool)status of execution.if successful True else False
    @return msg : (string) step message in case of exception
    """
    msg, status = "", True

    try:
        'Here we will pass object identifier for required element'
        text_heading = ui_controls.text_view(
            get_obj_identifier(objectidentifier))
        print "Current text returned by UI is==>" + str(text_heading)

        'To check if it is returning empty value here'
        if not text_heading:
            print str(
                validationtext
            ) + " text does not exist and it is returning empty value."
            return False, msg

        'Comparing text retrieved from UI with validation  text'
        if validationtext.strip() == text_heading.strip():
            print(str(validationtext) + " text has been found!!!")
        else:
            print("Sorry!!!text has been mismatched,it should be " +
                  str(validationtext))
            print("Text shown at UI is==>" + str(text_heading))
            return False, msg

    except Exception as excp:
        traceback.print_exc()
        msg += str(excp)
        status = False
    return status, msg