My Webpage contains text like 'User,'. I need to capture this text without comma. When i am doing assertEquals between the user entered text(User) and text retrieved from the webpage(User,), it failed because of extra comma.Can you help how to replace or remove that comma and getText?
Using the below xpath, i am capturing the text, driver.findElement(By.xpath("//div[@id='mainContents']/div[2]/div/table/tbody/tr/td")).getText();