Tag Info

New answers tagged

0

when you need to test ur site for mobile devices, best and economic thing is user agent. Just go to google.com, enable site emulation by right click on site and go to inspect element and go to Show Drawer (icon something like >= ) then go to Emulation and then to device, now select any kind of device you want to check.


0

This seems to be the case where you try to find the element (using findElement) before the page completely loaded its content. At that moment, the element might not exist. Selenium itself already waits for the page to load. But in some cases (JavaScript execution, for example), it doesn't know the page content is fully loaded. So, you need to add robustness ...


1

If ID is shown on the page - it is shown as text in some element. Which has some locator. Find that element and get it's text or value property, as appropriate.


0

I faced similar kind of problem earlier. Here is my suggestions 1- Don't just wait for page to load write a logic for it.Try to make several attempts after a given interval. (refer below mention code. language is perl) e.g. my $wait =some_value; my $url ="something"; for($i=0;$i<=5;$i++){ eval{ $selenium->get($url); } if($@){ print "$i attempt became ...


0

You can use reportNG. Its the reporting plugin for testNG. You can add your message using Reporter.log("Your Message"); If you want to add your alert messages in report and your project is Maven project then add following in pom.xml <reporting> <plugins> <plugin> <groupId>org.testng.xslt</groupId> ...


0

DesiredCapabilities caps = DesiredCapabilities.internetExplorer(); caps.setCapability(InternetExplorerDriver.INITIAL_BROWSER_URL, ""); WebDriver driver = new InternetExplorerDriver(caps);


0

Look at the given link for example- How To Handle JavaScript Prompt Box: http://reditblog.blogspot.in/2014/11/how-to-handle-javascript-prompt-box.html How To Handle JavaScript Confirm Box: http://reditblog.blogspot.in/2014/11/how-to-handle-javascript-confirm-box.html How To Handle JavaScript Alert Box: http: ...


4

Try this line of code: Driver.findElement(By.xpath("enter your xpath")).click(); Hope it works out!


0

The command should be: captureEntireScreenhot which is available in commands and the target should be the address of the folder where the screenshot is to be saved. This has to be written manually. Example as requested. WebDriver driver = new FirefoxDriver(); driver.get("http://www.google.com/"); File scrFile = ...


3

Try this Driver.SwitchTo().frame("Fancybox-frame"); Driver.findElement("enter your xpath to close popup").click(); Driver.SwitchTo().defaultContent();


-2

how to use the same Xpath for to pop ups


1

We are using Xvfb in our Continuous Integration environment and it is working great. It's no problem to take screenshots from Selenium for later analysis when errors are found. We have found no problems with this solution, rather a great advantage to be able to use virtual servers to spawn massively parallel tests against installations of the software.


0

I like to use a combination of techniques, the first involving a 'dependableClick()' which I have modified slightly starting with some code I found here on SE: public void dependableClick(By by) throws InterruptedException { final int MAXIMUM_WAIT_TIME = 10; final int MAX_STALE_ELEMENT_RETRIES = 5; WebDriverWait wait = new ...


1

I have written a blog on how to take screen shots while using webdriver APIs, This is a basic code but it will help you in taking screenshots. http://apttest.in/how-to-capture-screenshot-in-webdriver-using-java/ package screenshot_package; import java.io.File; import org.apache.commons.io.FileUtils; import org.openqa.selenium.OutputType; import ...



Top 50 recent answers are included