Since you say one of the two elements must exist then the solution is easy. Find just one of the two elements, if it exists then click it, if it doesnt exist then the other must so click the other. Pseudocode: if (BrowserFind(HANDLE_DESKTOP, "//div[@class='classA']", false, 3000, true) = HANDLE_INVALID) then BrowserClick("//div[@class='classB']|, BUTTON_Left, "classB"); // A doesn't exist so B must exist so click B else BrowserClick("//div[@class='classA']|, BUTTON_Left, "classB"); // A does exist so click it. end;
↧