Tag Info

Hot answers tagged

4

Yes, Selenium is an active project (see commit history on GitHub). Then why are there so many unresolved open issues? It's open source. We can't expect the team members to fix bugs on a daily basis, because they are just enthusiasts and all have real-life jobs. The developer in charge of a particular area may not have time to deal with it right away, even ...


3

Sadly, it sounds like using the ID is not an option in this scenario A lot of websites implement security to prevent automating. While this makes your job more difficult it does improve the security of the application. So what can be done to bypass these security tricks? Use a different unique constant for that element This could mean using the class, ...


2

Yes you should for the fact that it is "copied". Sure it is supposed to stay the same but if it is not the exact same code there is no guarantee that someone will not change the implementation. Write a test for that and then recall the same test method in every place instead of duplicating the test steps in every place. This will ensure it remains ...


2

You can't capture the id's every time, you need to find some other way of uniquely identifying the elements. I'm assuming this is a 3rd party tool that you don't have any control over, but if you do have control you could ask the developers to provide either a unique ID or some other unique identifier. Some other options you have would be to identify ...


2

Please Use select.selectByValue("Vodafone"); OR kindly post the HTML code and go through this Link Link As per your comments below updated the code: import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.ui.Select; ...


2

I just set the Selendriod up last week with this guide on the official site selendroid.io/setup.html. It's a step by step since System Requirements to the first test case. I think it's a good kickstart, pretty straight forward. You could post for a specific question, if you are struggling in any step. Hope it helps,


2

Try this , storing all the Web elements of Select list in a List and then getting its size. List<WebElement> optionCount = driver.findElements(By.xpath("//select/option")); System.out.println(optionCount.size()); Thanks.


1

@anshu Use .getText method and store the value in a string (Both step C and E) and compare the both the Strings, Ex: .equals. (Also you can use if-else condition).


1

You are comparing values, so better you store each values in the String and compare both the String values.


1

Use another identifier to identify the object or use xpath, for example: starts-with If your dynamic element's ids have the format where button id="continue-12345" where 12345 is a dynamic number you could use the following XPath: //button[starts-with(@id, 'continue-')] contains Sometimes an element gets identified by a value that could be surrounded ...


1

you can use following code to switch between windows based on the window title. or please go through this link Link private void handleMultipleWindows(String windowTitle) { Set<String> windows = driver.getWindowHandles(); for (String window : windows) { driver.switchTo().window(window); if ...


1

Please use below code. driver.get("http://www.flipkart.com/"); driver.manage().window().maximize(); driver.findElement(By.linkText("Trimmer")).click(); WebElement scroll = driver.findElement(By.id("brand")); scroll.sendKeys(Keys.PAGE_DOWN);


1

You can refer this link and let us know is this ok for you Link


1

As elcharrua writes you can use JavaScript in Java tests with the JavascriptExecutor. This will execute the JavaScript in the Selenium browser session if it was JavaScript from the website itself. But if you want to write the whole test in JavaScript look at WebDriver.JS Simple example var webdriver = require('selenium-webdriver'); var driver = new ...


1

You can try appium, https://github.com/appium/appium I believe there is some support for web testing however it may not be stable at the moment. Another option would be to try a service like https://www.browserstack.com/automate


1

Personally I would put a wait and in the wait try to click and then verify the popup exists, catch the error and try to click and verify again. That way as soon as it's ready it will return and you aren't using a timer. That is good practice anyway to not just wait a specific time, but wait for a particular event to take place and then move on. c# ...



Only top voted, non community-wiki answers of a minimum length are eligible