Tag Info

Hot answers tagged

4

You mean to say in one class multiple methods you want to run, then use below code and try. @BeforeTest public static void beforeMethod() { driver= new FirefoxDriver(); } @Test public void main1() { driver.get("http://indianrail.gov.in/pnr_Enq.html"); driver.findElement(By.id("element")).sendKeys("1234567890"); String ...


3

Alan Richardson has a great beginner book called Selenium Simplified. A good solid way to learn with code examples is to use his Udemy courses and then follow up with Java for Testers. I had a background with PHP, JavaScript, and of course CSS and HTML before getting into Selenium. Java isn't compiled with WebDriver, it's parsed. There's a ...


3

PageObjects The code of automated test cases should be easy to understand and not too complex. If a test fails, we want to know why and this as soon as possible. To allow this exists PageObjects. PageObjects are classes that contains WebElements and every actions associated with those. A PageObject looks like this: class HomePage { WebDriver driver; ...


3

I am in no way trying to be rude, but I think the hiring team may be setting themselves up for failure. Having worked on many many automation projects and worked with many people of varying skill levels, it is actually just about impossible for someone with no automation background to jump in to automation and get it right the first time. With no guidance ...


3

Yes, you can run headless with either Headless Chromium or with PhantomJS .. Keep in mind that running with Selenium Grid or SauceLabs is equally as good as running headless.


2

As I know captcha (Some captcha you can test) you can not test using selenium webdriver.


2

Set up a FirefoxDriver. It's the best supported driver and supports advanced features. Automate a simple test such as opening a page and verifying the page contents. No form filling or JavaScript at this point! Run the test to verify it's working. This is necessary for the next step. After every subsequent step (except committing) make sure all the tests ...


1

It doesn't make much difference in terms of the development or scripting. But I prefer eclipse because netbeans tends to occupy a lot of memory and lower system performance. It seems to hang after a couple of hours. In that sense eclipse is more stable than netbeans.


1

Sometimes it so happens that the wait commands do not work. Instead of the wait command of selenium try using Thread.sleep(); command of java. This command will pause execution of the script for the given time...


1

I found a workaround for this issue where I can check for the exception after each step using the [AfterStep] binding. This works for me, and tests that failed are now marked as inconclusive: [AfterStep] public void check() { var exception = ScenarioContext.Current.TestError; if (exception is WebDriverException ...


1

True to edit user3783352's answer but got some permission error. So here is the content of the post referred to in that answer- package <Your Package>; import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; import java.util.List; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import ...


1

Gestures - User can perform multiple clicks on submit button / search button occasionally which could result in page reloads / transactions cancelled Image / Video Previews - Between transitioning between thumbnail and playback of videos I have observed not well automated Payment gateway timeouts - During peak transactions there could be timeouts with ...


1

Although learning programming and web-testing with Selenium from scratch as an autodidact is totally possible. I think you should find a team that does both manual and automated web-testing. Try to gather more experienced colleagues around you and work with them. If finding a team is impossible due to lack of actual real life experience I suggest you ...


1

To become an expert test automator using selenium and java a manual tester should do the following, Learn java. Learn selenium. What it does? How it does it? Learn the limitations of selenium. Get hands on practice with selenium. Learn tips and tricks to use selenium effectively and efficiently. Learn how to customize selenium to make it more suitable for ...


1

I can see several problems in your code. Paramaterized @BeforeSuite method with no data provider. Your @BeforeSuite method (main()) takes a parameter (args), but you have not told TestNG how to provide a value for that. That's what that exception message means. Calling test methods. When you run under TestNG, your @BeforeSuite method calls your test ...


1

The right way to go about it would be to prepare not just for the interview but for the job itself. Do you have hands on experience in programming? Try learning java. Both, selenium and jmeter work on java. So learn the concepts. Once you learn java, google tutorials for selenium and java. Learn from them. Ask help from the testing community for one on one ...


1

If you're timing out, the WebdriverWait probably isn't finding anything - maybe a glitch in the XPath? Try validating it manually on the page. In the Chrome console, you can just use: $x("xpath here") Does that render any result? (I would've commented rather than replied, but I'm short two reputation points.)


1

There is a quote in front of the version. if you take it off your code should work i.e "version”:”6.1 should be "version”:6.1,


1

Ok, this isn't a bug. The XPath, when searching in the context of an element, must start with a dot. So this works: htmlControl = htmlDiv.FindElement(By.XPath(".//label[text()='Naam']/following-sibling::div[1]//select"));


1

There is nothing wrong with documentation. Need to specify page object classes as public classes.So moving GoogleSearchPage to different file and specifying it as public class should work fine. the way suggested here is also correct but is just an alternative.


1

There are some instances where selenium (watir) refuses to click a link or a button even when the xpath expression is valid and claims it found the object. In these situations I just use a jquery .click function with the .executeScript method as a work around.



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