est sous le code:Obtenir le temps exception en essayant d'identifier les webelemnt
WebElement Username=d1.findElement(By.xpath("//*[@id='username']"));
Username.sendKeys("aadmin");
WebElement Password=d1.findElement(By.xpath("//*[@id='login_form']/tbody/tr/td/table/tbody/tr[12]/td[2]/input"));
Password.sendKeys("admin");
WebElement signin=d1.findElement(By.xpath("//*[@id='submit_']"));
signin.click();
System.out.println("User admin has logged in "+ d1.getTitle());
w1.until(ExpectedConditions.elementToBeClickable(By.xpath("//*[@id='spaces-menu']/ul/li[1]"))).click();
System.out.println("User Admin clicks on Record button");
//Thread.sleep(5000);
d1.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
//Switching the control
int size2=d1.findElements(By.tagName("iframe")).size();
System.out.println("iframe size is---" + size2);
WebDriverWait w2= new WebDriverWait (d1, 15);
//w2.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(0));
w2.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.tagName("iframe")));
System.out.println("Page title is "+d1.getTitle());
//d1.switchTo().frame("iframe-page-container");
//d1.switchTo().frame(d1.findElement(By.tagName("iframe")));
WebDriverWait w3= new WebDriverWait (d1,30);
WebElement New=w3.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[@id='capTypePopup']")));
//WebElement New=w3.until(ExpectedConditions.visibilityOfElementLocated(By.className("menu-middle-normal-button")));
//WebElement New=w3.until(ExpectedConditions.visibilityOfElementLocated(By.id("menuButtonContain-6")));
//New.click();
//d1.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
//JavascriptExecutor js = (JavascriptExecutor) d1;
//WebElement element = d1.findElement(By.id("menuButtonContain-6"));
//js.executeScript("arguments[0].setAttribute('type', '')",element);
//System.out.println(d1.findElement(By.id("menuButtonContain-6")).getAttribute("value"));
//Actions a1= new Actions(d1);
//a1.moveToElement(New).click(New).build().perform();
//d1.findElement(By.xpath("//*[@id='tr_menubar']/td"));
//d1.findElement(By.xpath("//*[@id='capTypePopup']")).click();
//w1.until(ExpectedConditions.elementToBeClickable(By.className("portlet-menu-item"))).click();
//w2.until(ExpectedConditions.elementToBeClickable(By.xpath("//*[@id='capTypePopup']/font"))).click();
System.out.println("Click on the new button");
est en dessous du DOM de la page, je suis en train de cliquer sur le bouton Nouveau qui à l'intérieur du iframe.
Ceci est le message d'erreur que je reçois, s'il vous plaît aider et suggérer: expiré après 30 secondes en attente de visibilité de l'élément situé par By.xpath: // div [@ id = 'capTypePopup'] Information de construction: version: '2.53.0', révision: '35ae25b', heure: '2016-03-15 16:57:40' Informations système: hôte: 'SandeepLT02', ip: '10 .4.224.42 ', os.name:' Windows 10 ', os.arch:' amd64 ', os.version: '10 .0', java.version: '1.8.0_144' Information sur le pilote: org.openqa.selenium.ie.InternetExplorerDriver –
Avez-vous toujours l'erreur, quand vous essayez de passer explicitement à l'image d1.switchTo(). frame (d1.findElement (By.tagName ("iframe"))); , puis effectuez l'action. L'erreur se produit-elle, même si vous déboguez pas à pas? Cela pourrait vous aider à affiner, si c'est un problème avec l'attente ou autre chose? –
Votre xpath n'est pas correct, il trouve plusieurs éléments. Je vais vous suggérer de trouver plus de xpath unique pour votre élément – iamsankalp89