The Stack Overflow podcast is back! Listen to an interview with our new CEO.

New answers tagged

0

I am not sure if you used the Page Object (PO) correctly. Basically, in PO for each web page/element in the application, there should be corresponding page class. As an idea in your case, define one class for the first page (submit data), and another class for second page (e.g the one which queries and shows the data). And 3rd class which is the main test ...


0

The browser close button cannot be hovered with WebDriver. You could try to close the current window with driver.close() and see if the close is blocked and the message is shown. Move mouse top top of page: https://stackoverflow.com/questions/12974488/selenium-webdriver-move-mouse-to-point You could try to automate non browser page actions with SikuliX or ...


0

Wonder if you really want to test the implementation details of a JavaScript method via an end-to-end testing framework. Probably the method can be tested on a different level in the test pyramid. For end-to-end tests build checks for the actual user behavior, not the implementation.


2

I agree with Niels` suggestion of checking the database. An alternative could be refreshing the page, or navigating back and forth and asserting that you still see the value. That would imply that the data is stored. But before that I would suggest talking with your development team (if that is the case here) and see if this check for storing in the ...


7

How do users verify the data is saved? I would make the test take the same path. In your case placing an order might result into an item in the checkout shopping-basket. Find elements in the shopping basket and count them, get their text and validate that with an assert library (JUnit or TestNG). Simple example: WebDriver driver = new ChromeDriver(); // ...


0

runs fine with chromium: thufir@dur:~/NetBeansProjects/scrape$ thufir@dur:~/NetBeansProjects/scrape$ gradle run > Task :run Starting ChromeDriver 75.0.3770.90 (a6dcaf7e3ec6f70a194cc25e8149475c6590e025-refs/branch-heads/3770@{#1003}) on port 25016 Only local connections are allowed. Please protect ports used by ChromeDriver and related test frameworks ...


0

Try this solution. Works perfectly in Google Chrome dev tools console.


0

As far as I know, Gradle does not control the execution order. Instead use the TestNG priority annotation. example: @Test(priority=0) public void test1(){ System.out.println("First Test"); } @Test(priority=1) public void test2(){ System.out.println("Second Test"); } And maybe set the order for classes in Testng.xml e.g here.


0

Selenium is interacting with system's GUI that is responsible for drawing the windows and dispatching user interactions to certain UI elements. When you run your tests having remote desktop window open (or when you logged on the session on your local machine) Selenium can obtain GUI objects since it can see them just like you do. Once you close or collapse ...


0

You just fuel add with the database and manipulation with the data base that is the best option for drop down list


4

You can get the selected value from dropdown using getFirstSelectedOption() and getText() methods. System.out.println("Selected country: " + drpcountry.getFirstSelectedOption().getText()); For reference: http://seleniumtwo-by-arun.blogspot.com/2013/07/144-using-getfirstselectedoption-with.html


0

Try actions. And also rather creating varaible, recall element again while call send keys, such as Actions myaction= new Actions(Driver.driver); myaction.sendKeys(Driver.driver.findElement(By.xpath("//*@id=\"centralForm:startSerialNumber_input\"]")), Integer.toString(i)) .build() .perform();


1

Another option you could try is Google Voice (voice.google.com). This will give you a web interface to a phone number which is free for your first number. I have used the app to test two factor authentication, so it should work for at least manual testing of your scenario. Google allows you to have one number without charge, but you need to pay for any ...


1

There is no straightforward solution for something like this, since it is a content specific problem. StaleElementReferenceException, according to Selenium docs, is thrown in one of two cases: A stale element reference exception is thrown in one of two cases, the first being more common than the second: The element has been deleted entirely. ...


0

You can use the solution like https://play.google.com/store/apps/details?id=com.llamalab.automate so that you configure a Flow which monitors incoming SMS messages and dumpd them to a file. Then you mount file system of your phone to your pc where the tests are being executed (e.g. by pluging it via a cord) hence making your automated tests monitor the ...


0

I had posted this question to the Microsoft queries and I got the below solution. https://macops.ca/installing-webdriver-as-a-feature-on-demand-in-windows-redstone-5/ This link shows how to install a webdriver for the latest version. I tried and it worked for me.


Top 50 recent answers are included