java - Selenium testcase execution speed issues -
I have an issue with Selenium where I can pass a test case, but the problem test is very quick. Is there any way or feature through which I can control the speed of execution? Any time I am facing big time for this problem, any help would be appreciated. Below is my script for reference.
Package test. Selenium; Import java.util.concurrent.TimeoutException; Import org.openqa.selenium.By; Import org.openqa.selenium.WebDriver; Import org.openqa.selenium.WebElement; Import org.openqa.selenium.ie.InternetExplorerDriver; Import org.openqa.selenium.support.ui.ExpectedCondition; Import org.openqa.selenium.support.ui.Select; Import org.openqa.selenium.support.ui.WebDriverWait; Import org.testng.annotations.AfterTest; Import org.testng.annotations.BeforeTest; Import org.testng.annotations.Test; Public class test {WebDriver driver; Public Traffic Group UPDateTestNG () {} / ** * @throws java.lang.Exception * / @BeforeTest Public Zero Setup () throws exceptions // // Use Internet Explorer and set up driver; System.setProperty ("webdriver.ie.driver", "D: \\ IBM \\ selenium \\ IEDriverServer.exe"); Driver = New Internet Explorer Driver (); // And now go to this URL driver.get ("URL of JSP"); } / ** * @ thresh java.lang.Exception * / @AfterTest public zero tiredown () throws exception {driver.close (); } @Test Public Final Zero Test () {Final Web Element Form Element = Driver.Fix Element (ByID ("Search")); Select the last drelement = new (drelement.findElement (By.id ("my_input")); Drelement.selectByIndex (0); Last Web Element submit = driver.findElement (By.id ("Submit")); Submit.click (); Looks like elements from AGX calls that documents are not visible or are not ready. I have ready status updates, working with my web division, I added a waiting class while loading them, and when they If you work, remove it. As a result, I was able to wait until AJAX was finished. It is in C # but it is quite easy to translate to Java.
Comments
Post a Comment