I'm wondering if it's possible to pass locator as parameter in data driven test? For example:
//this is non-parameterized object RADIO_BUTTON locator
WebElement radiobElm = driver.findElement(RADIO_BUTTON);
radiobElm.click();
vs.
//I'd like to pass locator "RADIO_BUTTON" as string (strRadioButton) from Excel sheet, so for each test iteration my script will click on different radio-buttons. Is it possible?
WebElement radiobElm = driver.findElement(strRadioButton);
radioElm.click();
One of the many ways to accomplish this would be to use same method to find elements and read the locator from excel file.
Of course you have to do all of other works to read the correct cell from excel.