I have a Website where the userID differs for every login, Say for example When i login with userID 'Username1' this contains 0 to 8 characters, similarly if i login with userID 'Username123' contains 0 to 10 characters
I need to automate in such a way, that for every login system stores the user ID in a variable as follows
String FullUsername=driver.findElement(MyTeamInboxPage.username).getText();
My result for the userID 'Username1' would be Username1
I am gonna take substring from 4 to till end as follows
String actual=Fullactual.substring(4, 8);
But the sub string code will not work for every userID. How can i change my SubString code end character alone in such a way, it should work for every User ID