Approach 2: Using By for exposing elements

protected By metric_tab = By.xpath("//a[.='Metric Units']");
protected By age_txt = By.id("cage");
protected By male_rab = By.id("csex1");
protected By female_rab = By.id("csex2");
protected By height_txt = By.id("cheightmeter");
protected By weight_txt = By.id("ckg");
protected By calculate_btn = By.xpath("//input[@alt=\"Calculate\"]");
protected By result_lbl = By.className("bigtext");

Last updated

Was this helpful?