Skip to main content

Posts

Showing posts from May, 2020

How to create Xpaths

Xpaths to identify elements on the UI. Below are some different ways to create Xpaths: //tag[@attribute='Value'] where tag is html tag and attribute like (class, id, etc) eg. //div[@class='classname'] or //div[@id='idvalue'] //tag[contains(@attribute, attributepartialvalue)] where could not find unique  values or attribute value is dynamic, could use partial value of attribute by using contains in the xpath. eg. //div[contains(@id, 'partialvalue')] //div[starts-with(@id,'partialvalue_')] Attribute which has fixed value at start can use xpath as //div[contains(text(), 'text value')] or //div[text()='value'] where text can be used to find the element

What value is assigned to fields of Object when it is initialized

When a object instance is created, what value is being assigned to its members? The value of members is assigned as default value, which  is: Integer = 0 integer type of members are set to default value as Zero (0) String = null String type of members are set to default value as NULL Reference type member Any reference type member default value is assigned as NULL