Reputation: 225
How to test the ads which displayed on web page. This ads are injected thorugh some plugins. When I record using IDE, it displays the adds on Firefox browser. But when I run the webdriver selenium script from eclips, it does not show any ads, on the webpage of browser launched by selenium..
How to rectify this issue?
Upvotes: 3
Views: 3287
Reputation: 2199
By default, Selenium uses a Firefox profile which is separate from your normal profile when you open the browser manually. So, plugins you've added using your normal profile will not be available to Selenium by default.
So, if ads are injected into a page by a plugin you've installed, that would explain why you aren't seeing them without the plugin when you open FF with Selenium.
You can create a profile to use with Selenium by following these steps:
firefox.exe -ProfileManager -no-remote
And then in Java, set up your driver to use that profile - for example, if you create a profile called "SELENIUM", your java might look like this:
ProfilesIni profile = new ProfilesIni();
FirefoxProfile ffprofile = profile.getProfile("SELENIUM");
driver = new FirefoxDriver(ffprofile);
Upvotes: 4
Reputation: 14748
Testing experience from me: I work for German company, placed in Czech Republic. And there is the page which targets Czech audience. So the AdWords are made for Czech people.
But the company firewall is placed in Germany, which means, that the page thinks I sit in Germany, although I sit in Prague. Which also means that no ads are being displayed to me.
Long story short: Make sure you do not have some another issue like this when running selenium and when running from your browser...
Upvotes: 2