New answers tagged

-1

Its possible using Selenium WebDriver's TakesScreenshot interface. Visit https://seleniumlive.wordpress.com/2016/06/24/how-to-capture-screenshot-of-screen-using-webdriver-with-java/.


0

Simple ready2use snippet > Working perfectly for me static void waitForPageLoad(WebDriver wdriver) { WebDriverWait wait = new WebDriverWait(wdriver, 60); Predicate<WebDriver> pageLoaded = new Predicate<WebDriver>() { @Override public boolean apply(WebDriver input) { return ((JavascriptExecutor) input)....


1

What you could do, is try to use an existing profile in the browser, so that way it would actually save the cookies somewhere. Otherwise the webdriver starts up an anonymous profile every time that doesn't save the cookies, it just throws them away when the browser is disposed of. This is mentioned in this SO Answer to Selenium Webdriver not respecting ...


0

I had put my code to implement for new webdriver code as below ,refer this page: https://github.com/becausetesting/commons/blob/master/src/main/java/com/github/becausetesting/cucumber/selenium/RemoteWebDriverEx.java : just use this code to use existing started selenium session: WebDriver driver=new RemoteWebDriverEx(true); full code as below sample: ...


0

I wonder how you even able to open the application? Because you have an empty space in side string many places. Problem #1 Change from : driver.get(" http://192.168.1.10:8080/sptest/home "); to : driver.get("http://192.168.1.10:8080/sptest/home"); Problem #2 Change from: driver.findElement(By.xpath(" .//*[@id='homeMainContainer']/div[1]/div/div/...


0

I think in first case, after you clicked loginenter button, it should be added some wait time to reload page so selenium driver can not locate the element. So I suggest you to add some condition to wait next element. Please try below codes; WebElement myDynamicElement = (new WebDriverWait(driver, 10)).until(ExpectedConditions.presenceOfElementLocated(By....


-1

Try SmartBear's TestComplete. It works well with web apps and desktop apps. https://smartbear.com/product/testcomplete/overview/


0

Yes you can automate it using BrowserMob Proxy. [Please use the below mentioedn link to test Network traffic using BrowserMob Proxy https://keshavtechinfo.wordpress.com/web-automation/selenium/web-page-load-testing-using-selenium-and-browsermob-proxy/ ]1


0

If you want to start with selenium ,I would mention some points what i followed during my initial learning of Selenium. First of all start learning any of the programming language concepts (i learned Java). Using Selenium IDE start finding the elements of web pages. Then try to make small scenarios for a particular functionality. Then try coding with ...


0

You can use ExtentReport. You can use it to log your test steps and once its done it will generate a report to show your results. It will also show all fails and help you distinguish between assertion and an actually test fail. This is why we implemented it into our enviornment. Here is how to set up ExtentReports on your project with examples - http://www....


0

You could use the 'facade' pattern. You put all methods for every single page into one class, create an instance of that class and just use that object to make every single call. This makes it easier to use and develop but pretty hard to maintain as the application grows more complex. https://en.wikipedia.org/wiki/Facade_pattern I want to clarify - POM is ...


2

My main criteria is readability and maintainability. Speed has never been as issue for me. There's other parts of the test frameworks I use that have much more significant speed issues. The basic idea is always 'what will it take to uniquely identify the element' with two principles: Don't over specify the page structure - this will make the selector ...


0

You need to find the element and than extract the text from it. Following is the code for the same. WebElement element = driver.findElement(By.xpath("//div[@class='f1']/p")); String text = element.getText();


0

It depends on by which locator your element get located, but you should always follow the order following is top priority(fast) to low priority(slow) locator. ID Name Link text Partial link text Tag name Class name CSS Xpath


2

driver.ExecuteScript(string.Format("document.getElementById('cred-password-inputtext').value='{0}';",password)); This solution has resolved my problem.


0

We had faced same issues in the past. On node server before launching new node check any existing instance was running. Forcefully close the browser instances before again passing control back. Added bat file to do this functionality. It works perfect.



Top 50 recent answers are included