Skip to content
Advertisement

Tag: selenium-webdriver

TestNG. can’t run a single test method

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

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

Advertisement