I'm new to coding and I have the following issue while automating with Selenium using Java:
I'm testing a SaaS solution and I need to refresh my page until a certain item appears in my inbox. I cannot simply use the findelement statement since the item only appears after some time and onlywhen the page has been refreshed. Furthermore all inbox items have a unique sequential number in the title. This unique number I have saved as a string variable and I want to use this string variable to see if the inbox item has appeared after refreshing the page some times.
Code for finding unique string:
//Get expense report number
String filename = strng;
String ExpenseReportNumber = StringUtils.substringBefore(filename, " submitted"); // returns Expense Report #XXXX
Now I need to create a loop in which the site keeps refreshing until it gets a hit on the string variable. When it finds the string variable I then can select the top element on the inbox and continue my test.
Can someone assist me with this issue or give me advice on how to create the same outcome but then with a better approach? Much appreciated!