I have a webpage where different action buttons are available. I am identifying the action buttons using the CSS selector. I want to have a common method to click on the action buttons using the parameter of method. All the buttons have similar attributes but different values.
Please look into the code.
public static void TakeAction(WebDriver driver, String Action)
{
WebElement btnAction= driver.findelement(By.cssSelector("input[type='button'][value='Action']").
btnAction.click();
}
Now this [value='Action'] -> Action should be picked from the method parameter however i am not able to figure out the syntax to specify the same.
Any help will be appreciated.