When i click on patient ,i will get a JavaFX popup .How can i handle the same using selenium?
I have to check the title and click on OK
When i add the driver to watch list
i am doing
fxdriver.findElement(By.cssSelector("text[text*='discharged']").getText() - return nothing
I just cant inspect the same and i have created a fxdriver which handles the page but when the popup comes out i cant do anything with the application (application freezes out) until i click on OK in the popup
Related
I have a scenario to save a PDF which is opened in a window. By default selenium control moves to the Window, As it is a banking application I cannot repost the URL to save the pdf, I cannot press CTRL + S and right click doesn’t have any required data but using Robot I can click or move to an element, now the save button will enable only if you mouse over at the bottom of the page. I tried using ROBOT mouse over but the pop up did not popped up may be the reason it is not navigating via UI.
I have tried Sikuli also as the save pop up only pop up while mouse over that also failed.
We cannot use Actions as it wont support Webdriver driver, I have used Sikuli and ROBOT class mouse over.
The save Pop up opens only when it is mouse over at the bottom of the page, and it is not happening in ROBOT class as it navigates via DOM. please help
So I'm currently working on a new project and I need to write some automated tests.
I came across a problem and I don't know how to fix it. If the button of my web page is clicked running selenium it doesn't perform any actions, but if I open the web page manualy and click on the button, everything works fine.
NOTE: I'm completely sure that the xpath is correct and the button is being clicked...
This is what happens running with selenium:
And this is what happens openning the web page manually and clicking on the button:
I am working on ui automation testing using nightwatch.js, i am struggling on a point, i want to click on alert box's "OK" button but i am unable to do it because i didn't find anyway to press alert box's "OK" button on browser using nightwatch.js.
is there any way please suggest.
You can use the Selenium acceptAlert protocol. It can be used like this:
browser
.url(APP_ROOT)
.waitForElementVisible('.classThatOpensAlert', 2000)
.click('.classThatOpensAlert')
.pause(1000)
.acceptAlert()
I was trying to identify the element in the google play store using firebug the element was identified by the firebug successfully but when I execute the selenium code it throws Invalid selector exception.
1. Login to playstore with the gmail account.
2. In the search box, type whatsapp and click on install button
3. It opens popup, I wanted to click on dropdown values and then click on install or just click on cancel button
For the cancel button, I wrote the following code:
driver.findElement(By.xpath(".//*[#id='purchase-cancel-button']")).click();
which is not working.
Try with below cssSelectors
By.cssSelector("button[id='purchase-cancel-button']");
Or
By.cssSelector("div.modal-dialog button[id='purchase-cancel-button']");
This item is currently invisible so you have to make a delay for a couple of seconds, f.e.
`
(driver.find_element_by_xpath(
'//*[#id="body-content"]/div/div/div[1]/div[1]/div/div[1]/div/div[3]/div/div[1]/span/span/button')).click()
time.sleep(4)
(driver.find_element_by_xpath('//*[#id="purchase-ok-button"]')).click()
`
the biggest issue i'm having is that when i click on a link, i can see the confirmation dialog popup. from this site it says:
NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible dialog.
NOTE: Selenium does NOT support JavaScript confirmations that are generated in a page's onload() event handler. In this case a visible dialog WILL be generated and Selenium will hang until you manually click OK.
any idea why i'm seeing a popup when i shouldn't be, or how i can click the 'Ok' on it?
edit: when i record the test using the selenium IDE and run it, it handles confirmation boxes fine. when i exported that test case to PHP, it doesn't work. this is without modifying the code -- using purely what was provided by the IDE.
Try to call
chooseOkOnNextConfirmation() function
From http://release.seleniumhq.org/selenium-core/0.8.0/reference.html