TESTEVERYTHING

Friday 22 July 2016

Available Android app of Testeverything Site

Hi,

Now you view the TestEverything Site updates on your Android mobile.just download the android app

Please refer the below link to download the apk file of  Teverything Site.

https://drive.google.com/file/d/0B27kZ9NQHijSQnJtc1RYdGVyR2M/view?usp=sharing

Download TesteveryThing APK file
TesteveryThing APK



Sunday 3 July 2016

Scroll the WebGrid using selenium webdriver

Hi,

Sometimes in webpage there is web table grid present on page and we need to scroll the grid to access the element information. Because of asynchronous call data will not load completely until unless you scroll the grid.

From wiki..

Synchronous means that you call a web service (or function or whatever) and wait until it returns - all other code execution and user interaction is stopped until the call returns. Asynchronous means that you do not halt all other operations while waiting for the web service call to return
Here I have written the method that will scroll your grid until it reach to end of data row.

Note: ElementXpath will be your data table rows xpath
like  ElementXpath = "//table//tr";



public static void ScrollView(WebDriver driver,String ElementXpath) throws

Exception {

int elemntCountBeforeScroll= driver.findElements(By.xpath(ElementXpath)).size();

if (elemntCountBeforeScroll>0){


WebElement element = driver.findElements(By.xpath(ElementXpath)).get(elemntCountBeforeScroll-1);

JavascriptExecutor jse = (JavascriptExecutor) driver;

jse.executeScript("arguments[0].scrollIntoView(true);", element);

Thread.sleep(8000);


int elemntCountAfterScroll= driver.findElements(By.xpath(ElementXpath)).size();

for (int i = 0; i < elemntCountBeforeScroll; i++) {
if(elemntCountAfterScroll>elemntCountBeforeScroll)
{ elemntCountBeforeScroll = elemntCountAfterScroll;
 element = driver.findElements(By .xpath(ElementXpath)).get(elemntCountAfterScroll-1);
 jse = (JavascriptExecutor) driver;
 jse.executeScript("arguments[0].scrollIntoView(true);", element); 
Thread.sleep(8000);
elemntCountAfterScroll = driver.findElements(By .xpath(ElementXpath)).size(); }
}
}
}

Which one is right ?

Translate







Tweet