System.out.println("Total values in Badge panel is " + Content.size()); // storing id in a string String x = Content.get(0).getAttribute("id"); System.out.println("id of the CTA button " + x); // using id to click on the link driver.findElement(By.id(y)).click();
I am able to print the id which I searched for. But I am not able to use it to locate element. Is there anything wrong?
Thanks in Advance
M
Replied on 11/02/2016
You are fetching the id in String x, but while clicking you are passing String y.