Answer the question
In order to leave comments, you need to log in
Selenium crashes when trying to start firefox. What could be the problem?
in the configured Eclipse environment, the test exported from Selenium IDE crashes with an error on the line
"driver = new FirefoxDriver();"
all the necessary heats are connected
, what could be the reason for this?
complete code
import java.util.regex.Pattern;
import java.util.concurrent.TimeUnit;
import org.junit.*;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;
public class Ex5 {
private WebDriver driver;
private String baseUrl;
private boolean acceptNextAlert = true;
private StringBuffer verificationErrors = new StringBuffer();
@Before
public void setUp() throws Exception {
driver = new FirefoxDriver();
baseUrl = "http://ya.ru/";
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
@Test
public void testEx5() throws Exception {
driver.get(baseUrl + "/");
driver.findElement(By.id("text")).clear();
driver.findElement(By.id("text")).sendKeys("selenium");
driver.findElement(By.xpath("//button[@type='submit']")).click();
}
@After
public void tearDown() throws Exception {
driver.quit();
String verificationErrorString = verificationErrors.toString();
if (!"".equals(verificationErrorString)) {
fail(verificationErrorString);
}
}
private boolean isElementPresent(By by) {
try {
driver.findElement(by);
return true;
} catch (NoSuchElementException e) {
return false;
}
}
private boolean isAlertPresent() {
try {
driver.switchTo().alert();
return true;
} catch (NoAlertPresentException e) {
return false;
}
}
private String closeAlertAndGetItsText() {
try {
Alert alert = driver.switchTo().alert();
String alertText = alert.getText();
if (acceptNextAlert) {
alert.accept();
} else {
alert.dismiss();
}
return alertText;
} finally {
acceptNextAlert = true;
}
}
}
Answer the question
In order to leave comments, you need to log in
thanks for the support. dealt with the issue. it turns out that not all jar-ki connected
libArray = {
"Лес": 1234,
"Дача": 872343,
"Хлеб": 8734,
"Аккуратность": 4343
}
findIt = "Лес" #Значение, которое ищется
if findIt in libArray:
print(libArray[findIt])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question