Selenium script for running a Batch File which will help to change the Browsers Proxy Settings

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Selenium script for running a Batch File which will help to change the Browsers Proxy Settings

Aniruddha
Hello Friends,

I need help from you guys on one of the tasks I have been assigned.

Make a script which will run a batch file and launch browser and help change the proxy setting of the browser, something like;

1. Execute Batch File
2. Launch Browser
3. Go to Lan Settings
4. change proxy settings.

Note: There should be a text file for inputting the servers and it should allow everything here.

Hope to get help from friends.

--
Thanks & Regards,

Aniruddha Malvi

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAFZDUkK%3Dg4nCxACC1%3DTctYHoChtsAG%3DOeg7JUWaV8AsDhiZ%2Bpw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Selenium script for running a Batch File which will help to change the Browsers Proxy Settings

cassian
You can write a power shell command to do that. In order to call PowerShell commands from your java code, just use JPowerShell. 

I found something like this to update settings of IE browser.

String command = "set-itemproperty -path "hkcu:Software\Microsoft\Windows\CurrentVersion\Internet Settings" -name ProxyServer -value "http=proxy-url:port;https=proxy-url:port;ftp=proxy-url:port;socks=proxy-url:port;" -type string";

powerShell = PowerShell.openSession();

//Print results    
System.out.println(powerShell.executeCommand(command).getCommandOutput());

powerShell.close();

Thanks & Regards,
Cassian Raja .T

On Thu, Jun 7, 2018 at 12:22 PM, Aniruddha <[hidden email]> wrote:
Hello Friends,

I need help from you guys on one of the tasks I have been assigned.

Make a script which will run a batch file and launch browser and help change the proxy setting of the browser, something like;

1. Execute Batch File
2. Launch Browser
3. Go to Lan Settings
4. change proxy settings.

Note: There should be a text file for inputting the servers and it should allow everything here.

Hope to get help from friends.

--
Thanks & Regards,

Aniruddha Malvi

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAFZDUkK%3Dg4nCxACC1%3DTctYHoChtsAG%3DOeg7JUWaV8AsDhiZ%2Bpw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CABh6KKsQmEbyqg3YRtUgmQ48e9R9uoM-7gEYD2ERSJ27E4Psng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.