CodePudding user response:
You were almost there but the locator strategy for the link Know More... was slightly off as there are multiple elements with almost similar attributes:
Solution
You can use either of the following locator strategies:
Using partialLinkText:
WebElement frame = DriverManager.getDriver().findElement(By.cssSelector("frame[name='login_page']")); DriverManager.getDriver().switchTo().frame(frame); DriverManager.getDriver().findElement(By.partialLinkText("More...")).click();
Using cssSelector:
WebElement frame = DriverManager.getDriver().findElement(By.cssSelector("frame[name='login_page']")); DriverManager.getDriver().switchTo().frame(frame); DriverManager.getDriver().findElement(By.xpath("div#welcomesec1 span.lightbluecolor > a")).click();
Using xpath:
WebElement frame = DriverManager.getDriver().findElement(By.xpath("//frame[@name='login_page']")); DriverManager.getDriver().switchTo().frame(frame); DriverManager.getDriver().findElement(By.xpath("//div[@id='welcomesec1']//span[starts-with(., 'Your security is of utmost')]//following::span/a[starts-with(., 'Know') and contains(., 'More...')]")).click();