Wednesday 29 March 2017

Change Different Network Speed in IPhone(3G to 2G)

How to Change network Speed in Iphone.

Requirement ::

1. Mac OS
2. Iphone (Any version)
3. Iphone Cable
4. Wifi or Mobile Data

Steps to Change network::

Step1 ::
     
           Connect Cable to Mac Os & Iphone

Step 2 ::
   
           Go to Settings

Step 3 ::

       Scroll Down to Developer Option. & Select Developer Tab.


Step 4 ::

            Now Click on Status Tab.



Step 5 ::

          Now Select Which network u require to operate Network.



Continue with using Speed based network..



By 

Harikrishna Recharla


      

Friday 24 March 2017

Create New Simulator in XCODE

Setup for Creating New Simulator in Xcode.

Requirement ::

1.MAC os
2.Xcode


Install xcode from AppStore

Signin With your Apple ID

Step 1::

Open Xcode.

Click on Create a new Xcode Project


STEP 2 ::


STEP 3 ::



STEP 4 ::

Select folder And Click on Create.

STEP 5 ::

 U will get below screen.

STEP 6 ::

Click on play Button 

You Will see Simulator.




All The Best

Launch Application with Different Browsers

Launching Browser With Different Ways with FIREFOX, CHROME, IE, SAFARI, OPERA





public WebDriver Launch()
{
String browser = getpropvalue("Browser");
if (browser.equalsIgnoreCase("ff")) 
{
wdriver = new FirefoxDriver();
}
else if (browser.equalsIgnoreCase("chrome")) 
{
ChromeOptions options = new ChromeOptions();
options.addArguments("--disable-notifications");
System.setProperty("webdriver.chrome.driver", getpropvalue("chromepath"));
wdriver = new ChromeDriver(options);
wdriver.manage().window().maximize();
navigateToURL();
}
else if (browser.equalsIgnoreCase("ie")) 
{
System.setProperty("webdriver.ie.driver", "./drivers/IEDriverServer_x32_v2.47.0.exe");
wdriver = new InternetExplorerDriver();
}
else if (browser.equalsIgnoreCase("safari")) 
{
wdriver = new SafariDriver();
}
else if (browser.equalsIgnoreCase("opera")) 
{
wdriver = new OperaDriver();
}
launchBrowser();
return wdriver;

}

Thursday 23 March 2017

Asserting value using testNg

Assert using TestNG

Compare Two Different Strings values




public void assertvalue(String actual,String expected)
{
Assert.assertEquals(actual, expected);
Reporter.log("Expected ::"+actual+"  Expected::"+expected, true);

}

Read Config.Proprties file

How to Read Config.properties File with Key & Value Pair




public String readPropertyOf(String key){

String propValue = null;
try {
FileInputStream input = new FileInputStream("./config.properties");
Properties prop = new Properties();
prop.load(input);
propValue = prop.getProperty(key);
} catch (IOException e) {
System.out.println("Caught the below exception!");
e.printStackTrace();
}
return propValue;

}




public static void main(String[] args)
{
   String readname =   readPropertyOf("name");
    System.out.println(readname);

  }

Scroll Web Application in Selenium Webdriver

Scroll Application UP & DOWN Until Element Visible

Scroll UP ::


public  void scrollup(String xValue
{    
String parameter="scroll(" +xValue+ ",0)"
JavascriptExecutor jse = (JavascriptExecutor)wdriver;
jse.executeScript(parameter); //xvalue '500' can be altered

}


Scroll Down ::

public  void scrolldown(String num) {
JavascriptExecutor jse = (JavascriptExecutor) wdriver;
    jse.executeScript("window.scrollBy(0,"+num+")", "");
}



Scroll Until Element Visible ::


public  void scrollToElementViaJavascript(WebElement element
{        
((JavascriptExecutor) wdriver).executeScript("arguments[0].scrollIntoView();", element);     
}



Monday 20 February 2017

Exceptions In Selenium

Exceptions we get in Selenium::

No such element
Null pointer
Unreachable browser exception
class not found in classpath
timeoutexception
not visible exception
element not selectable exception
Stale element exception
no alert exception
invalid exception
WebDriver Exception