Monday, August 15, 2016

BSNL offers free unlimited calls every Sunday

Customers of State-run BSNL will be able to make free limitless calls on every Sunday.

“BSNL...customers will be able to make limitless free voice calling from a BSNL landline to any network mobile and landline in the country on August 15, and thereafter every Sunday,” Telecom Minister Manoj Sinha verbally expressed in a verbal expression.

At present, it offers limitless night calling on any network in the country between 9 pm to 7 am as complimentary accommodation for all its customers.

BSNL commands around 57 per cent market share with 14.35 million customers.

“This accommodation will be available for all BSNL landline customers besides subsisting free calling scheme during night. For incipient customers we are now providing fine-tuned line connection for monthly rental starting Rs. 49 for first six months, and after that, a consumer can shift to any orchestration. The lowest monthly rental is Rs. 99,” BSNL CMD Anupam Shrivastava verbalized.

The free calling accommodation is available for all BSNL customers without any extra charge.

“These incipient schemes will let people experience modern facilities that are now available on BSNL landline network, like call forward to mobile phones, etc.,” Mr. Shrivastava verbally expressed.

The scheme is aimed at inspiriting people to utilize landlines when they are at home and preserve on mobile phone bills, a BSNL official verbally expressed.

“The fine-tuned line phones will be instrumental in proliferation of good quality broadband accommodation which is an essential element of Digital India. BSNL free calling scheme will pave the way for expansion of broadband accommodations in the country as well through fine-tuned line connection,” the official verbally expressed.

Thursday, August 4, 2016

mobile scroll command is not working in appium 1.5 for iOS application

Problem:-

I was using the following code to scroll to an element which is not visible.

WebElement element = driver.findElementByName("text");


JavascriptExecutor js = (JavascriptExecutor) driver;

HashMap scrollObjects = new HashMap();
scrollObjects.put("element", ((RemoteWebElement) element).getId());
js.executeScript("mobile: scrollTo", scrollObjects);

I am getting below error when I use above method for scrolling:-

Unknown command, all the mobile commands except scroll have been removed.

Solution:-

WebElement element = driver.findElementByName("text");
JavascriptExecutor js = (JavascriptExecutor) driver;

HashMap scrollObjects = new HashMap();
scrollObjects.put("element", ((RemoteWebElement) element).getId());
scrollObjects.put("direction", "down");
driver.executeScript("mobile: scroll", scrollObjects );

Wednesday, August 3, 2016

Workaround or solution for deprecated scroll and scrollTo methods in Appium



In java-client v4.0.0 - https://github.com/appium/java-client/releases/tag/4.0.0

scrollTo() and scrollToExact() became deprecated. They are going to be removed in the next release.

So I have found solution for scroll method in Android. Following is the working solution:-


Method to scroll:-


HashMap scroll = getScrollStartandEndElements(driver);
By by = By.xpath("//android.widget.TextView[@text="test"]");
for (int i = 0; i < 10; i++) {
    driver.swipe(0, scroll.get("start"), 0, scroll.get("end"), 1000);
    if (isElementPresent(driver, by).size() > 0) {
        waitElementToBeClickableByLocator(driver, by).click();
        elementFoundAndClick = true;
        break;
    }
}
Method to get x,y co-ordinates:-

public static HashMap getScrollStartandEndElements(AppiumDriver driver) {
    Dimension dimensions = driver.manage().window().getSize();
    Double screenHeightStart = dimensions.getHeight() * 0.5;
    HashMap scrollHash = new HashMap<>();
    Integer scrollStart = screenHeightStart.intValue();
    scrollHash.put("start", scrollStart);
    Double screenHeightEnd = dimensions.getHeight() * 0.2;
    Integer scrollEnd = screenHeightEnd.intValue();
    scrollHash.put("end", scrollEnd);

    return scrollHash;

}
Method for element to wait:-
public static WebElement waitElementToBeClickableByLocator(
        WebDriver driver, By by) {
    WebDriverWait wait = new WebDriverWait(driver, TEN_SECONDS);

    return wait.until(ExpectedConditions.elementToBeClickable(by));
}
Method for check element is present:-
public static boolean isElementPresent(AppiumDriver driver, By by) {
    boolean size = driver.findElements(by).size() > 0;
    return size;
}