I have Selenium+Eclipse+Java Project+Eclipse TestNG plugin. For example, my code is: When i run TestClass as TestNG, both tests are executed. I can’t understand why test2 is executed also. Because there is a comment “//” before @Test annotations. Any ideas? thanks in advance Answer First, you should clean the class files, then compile the project again
Tag: selenium-webdriver
How to use if else condition for searching element using WebDriver in Selenium?
I used else if concept I have not used try catch finally concept webdriver element finding using elseif loop how I want it to work : First it will check for “if” condition that is [if(driver.findElement(By.xpath(“username”)).isDisplayed())] and if it is not found it will not print any statement. because “if” condition is not seen it will go to “elseif” condition
How to verify an attribute is present in an element using Selenium WebDriver?
I have many radio buttons on my screen. When a radio button is selected, it has an attribute of checked. When the radio button is not selected, the checked attribute is not present. I would like to create a method that would pass if the element is not present. I am using selenium webdriver and java. I know I can
How to specify order of execution of Java classes in a Selenium-Java Webdriver test project
I have to automate a test-suite for a web application which let user connect and sync with their Dropbox account. I am using Java Selenium Webdriver. Here I have created test classes like this. Class1.java – Test case to check if connected to Internet. Class2.java- Test case for sign in with Dropbox Class3.java- Test case to verify if Dropbox folders
Selenium / Firefox: Command “.click()” doesn’t work with a found element
I tried to find a solution to this thing and I spent a lot of time, but it is almost imposible to me to do that. The matter: I am using Selenium with Java in Firefox. I need to find an element (a listbox) and click on it. So, the code finds the element, but click action does not work.
Switch tabs using Selenium WebDriver with Java
Using Selenium WebDriver with Java. I am trying to automate a functionality where I have to open a new tab do some operations there and come back to previous tab (Parent). I used switch handle but it’s not working. And one strange thing the two tabs are having same window handle due to which I am not able to switch
Best way to check that element is not present using Selenium WebDriver with java
Im trying the code below but it seems it does not work… Can someone show me the best way to do this? Answer i usually couple of methods (in pair) for verification whether element is present or not: Note that sometimes selenium can find elements in DOM but they can be invisible, consequently selenium will not be able to interact
How to click an element in Selenium WebDriver using JavaScript?
I have the following HTML: My following code for clicking “Google Search” button is working well using Java in WebDriver. I want to use JavaScript with WebDriver to click the button. How can I do it? Answer Executing a click via JavaScript has some behaviors of which you should be aware. If for example, the code bound to the onclick