Monday, May 18, 2015

How to handle the element when Id changes dynamically at the End





driver.findElement(By.cssSelector("button[id^='btnCreateNewCampaign']")).click();



Similarly

driver.findElement(By.cssSelector(“button[id^=’finish’][id$=’_NS_’]”));

it uses the regular expression with CSS  Selector where id^ looks for the word starting with finish and ends with _NS_.

No comments: