How to change IP with Selenium ?

255 views
Skip to first unread message

ZankOu75

unread,
Jul 30, 2015, 5:49:13 PM7/30/15
to Selenium Users
Hi everyone,

I'm a beginner in java & selenium.
For my website, i need to test some feature, and i need to simulate a flux to this website.

So i decided to developpe a bot that will go on the website thank to a link ( 2 lignes of code, great !)
But there is a problème, the website see that's the same session, so my test can't be validated.

How do i do to make my bot change is IP adresse every time he goes on the website ?



Here is my code, really basic. Any idea guys ?

package bots;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class Main {

public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://neo-web.fr");
}

}

Krishnan Mahadevan

unread,
Jul 30, 2015, 10:14:03 PM7/30/15
to Selenium Users
Selenium is not the tool for you. You might probably want to take a look at using BrowserMobProxy for this.

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 "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/70b36fd3-d5cf-4d46-a6a1-85a806f8fb45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages