I have a page that I am trying to test which basically consists of an upload button. Once you click the button you are given an uploader which will take a still image and convert it into a short video. The java code works fine on chrome and firefox but safari does not seem to ever see the uploader button or really any input box which uses sendKeys(). Any ideas on how to proceed?
Using Safari 9.1. Mac OS X 10.10.5. Selenium 2.52.0. SafariDriver is 2.48.0 which is the only one I can find on the Selenium website.
import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.safari.SafariDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.Assert;
import org.testng.aotations.*;
import org.openqa.selenium.support.ui.Select;
import org.openqa.selenium.firefox.FirefoxDriver;
import java.util.List;
import java.util.Iterator;
import java.util.concurrent.TimeUnit;
@Test
public void testLoopsUploadStillImage() throws Exception{
driver.get(insecureTestURL);
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
//Click Loops
driver.findElement(By.linkText("Loops")).click();
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
if(Browser.equalsIgnoreCase("safari")) {
WebDriverWait wait = new WebDriverWait(driver, 30);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("loopUploadInput")));
driver.findElement(By.id("loopUploadInput")).click();
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
}
driver.findElement(By.id("loopUploadInput")).clear();
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.findElement(By.id("loopUploadInput")).sendKeys(uploadFilePath + loopStillImage);
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
}
The major problem is that the page is actually loaded while selenium with safaridriver can not see the element. I can inspect the element in safari and see that it is there. It is not on the screen. The page loads quickly but selenium just sits there. The code works fine on chrome and firefox but doesn't work on safari. Since most of my tests involve input boxes or buttons for uploads, most of the test cases fail on safari.
It looks similar to this issue but there has been no movement on it: Selenium Safari Time out using findElement.sendkeys
I looked at this question but I am not using AJAX so I don't think it is relevant: Failed to load resource: Request timed out on Safari
I also looked at this but don't see any way in which it would help: org.openqa.selenium.TimeoutException when loading angular SPA
The rest of the stackexchange suggestions show questions without any answers. Are there any selenium experts who have any suggestions?
