Re: Android webdriver proxy settings

817 views
Skip to first unread message

siva

unread,
Jul 5, 2012, 2:09:44 AM7/5/12
to webd...@googlegroups.com
Can any help me to access internet(connected to proxy) through a app???? i am able to access internet through my browser but not through any app...

mukesh rawat

unread,
Jul 5, 2012, 3:15:06 AM7/5/12
to webd...@googlegroups.com
Hi SIva,
use this code:

DesiredCapabilities  caps = DesiredCapabilities.android();
caps.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
WebDriver driver = new AndroidDriver(caps);

siva

unread,
Jul 9, 2012, 4:56:12 AM7/9/12
to webd...@googlegroups.com
Hi Mukesh
   Thanks for ur reply... But that didnt work....

mukesh rawat

unread,
Jul 11, 2012, 3:09:55 AM7/11/12
to webd...@googlegroups.com

Vishal

unread,
Sep 25, 2012, 7:54:15 AM9/25/12
to webd...@googlegroups.com
i am getting the same issue.....Were you able to fix it? Can you please share the solution details.

On Thursday, 28 June 2012 12:23:52 UTC+5:30, siva wrote:
Hi
    I am new to android webdriver. I am using android 4 emulator. I have set the APN and its proxy settings. The Internet works fine in my emulator. But when i run the webdriver script, it gives a proxy authentication error in Webdriver app in emulator. Should i set proxy settings for the webdriver? Someone please guide me to solve this
I have attached the script below...
 
public class OneTest extends TestCase {

  public void testGoogle() throws Exception {
     
    WebDriver driver = new AndroidDriver();
   
    // And now use this to visit Google
    driver.get("http://www.google.co.in");
   
    // Find the text input element by its name
    WebElement element = driver.findElement(By.name("q"));
   
    // Enter something to search for
    element.sendKeys("Cheese!");
   
    // Now submit the form. WebDriver will find the form for us from the element
    element.submit();
   
    // Check the title of the page
    System.out.println("Page title is: " + driver.getTitle());
    driver.quit();
  }
}

Lukus

unread,
Nov 2, 2012, 11:14:38 AM11/2/12
to webd...@googlegroups.com
You might try the steps I posted about here:

I am able to get Android 4 (Ice Cream Sandwhich) proxy working with android-server-2.21.0.apk.  I was never able to get any option to work with the older webdriver apk's that support 2.2 Froyo.

Good luck.

HariPrasath Varadhan

unread,
Nov 2, 2012, 1:07:36 PM11/2/12
to webd...@googlegroups.com
Dear Lukus,

Its really a valuable reply for me..
I followed your steps, Its not working dude...

My work has been blocked for 2weeks because of this issue..
Pls have a look on my post 

Pls help me out with some solution..

Others, Pls provide your input.. It will be really helpful for me.. This is one of the most demand answer 

Regards,
Hari

Lukus

unread,
Nov 2, 2012, 4:51:21 PM11/2/12
to webd...@googlegroups.com
Hari, I won't write code for you, but am giving you clues, that then require you to do a little more research in order get the configuration just right for your situation.

- Have you tried the Proxy class?  You can see more about it in the JavaDocs: http://selenium.googlecode.com/svn/trunk/docs/api/java/index.html
but the general way to call it is:

DesiredCapabilities capabilities = DesiredCapabilities.android(); 
capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); 
Proxy proxy = new Proxy(); 
proxy.callAppropriateMethodsHere(); //not a real method but can set proxy settings various ways from Java docs
capabilities.setCapability(CapabilityType.PROXY, proxy); 
driver = new AndroidDriver(capabilities); 

- the other way I mentioned was setting the telephony databases via adb shell.  It sounds like maybe you tried that, but that's what is working for me with android-server-2.21.0.apk on Android 4.0 emulator with the latest updates in SDK manager.

- you might also check with your company's network guys to see if they can provide any feedback.  You can use packet capturing tools to determine where things are dying, but it can be a tedious process

Senthil kumar Kasi

unread,
Feb 24, 2014, 6:36:57 AM2/24/14
to webd...@googlegroups.com
Hi ,

I can set the proxy in android emulator . But i could not set proxy on android webdriver.

Please help me out for this issues. Thanks for advance...

On Monday, 26 November 2012 20:04:07 UTC+5:30, vinod kumar wrote:
heyy u got solution for that ??
Rite now i am also fecing the same problem./

Krishnan Mahadevan

unread,
Feb 24, 2014, 9:50:19 PM2/24/14
to webdriver
I believe that with 2.40.0 the client side of AndroidDriver has also been removed


You should really be considering moving towards Selendroid.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/


--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+...@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at http://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages