Robotframework android screen detection after pop-up - python

After closing a pop-up window, my code somehow does not recognize changed screen.
Short description: I press button, pop-up shows up that my "Camera is offline", I press OK, and then I am waiting until page has "Add new camera" written on here. In my screen it shows up, when I try to debug it also shows that this keyword is in page, but my test fails.
I tried to change elements which to wait till it shows.
I tried to use sleep function.
I have another places that the code does not work - when I close pop-up window, my code does not recognize new page.
Click Element com.yummiapps.eldes:id/a_add_camera_b_add #add button to get a pop-up window
Wait Until Page Contains Camera is offline and cannot be added #waiting till pop-up shows
Click Element com.yummiapps.eldes:id/d_e_b_ok #clicking on button from pop-uo
Wait Until Page Contains Add new camera #afte closing pop-up this segment always fails
Last code line should recognize that page is refreshed and it contains string "Add new camera"
pop-up window
after closing pop-up

Related

Popup keeps loading after click using Python Selenium driver

I need to scrape a name and phone number that appears when clicking a button in a popup.
I was able to complete these steps:
Navigate through the site
Click on "Ver teléfono" option. This opens a popup
Fill the form
Click on "Enviar" option. This shows a loading gif and nothing else happens
Here is the used code: https://www.mycompiler.io/view/6ukTEftFwyh
The expected result (tested outside selenium) is that the popup shows the name and phone number after clicking the "Enviar" option

Using python and chromedriver, how to click on a specific button of a pop-up window when I cant find his ID?

I have a code in python that uses selenium chromedriver to reach a webpage and collect some data but I want to solve a issue related with a pop-up window. For example, if you go to this webpage https://finance.yahoo.com/quote/BAC?p=BAC you will get two pop-up windows. One is for the acceptance of the collection of personal data (image below) and this I can handle well with the following code:
...
# Go to the website:
driver.get(main_url)
# Click accept button
driver.find_element(By.NAME, "agree").click()
...
The second one (image below) however I'm not being able to dismiss. I want the code to click on the "Maybe later" button but I cant find the button ID. Can someone help me?

Python selenium a button can't be clicked

I am new for python selenium. I have been working for a script and I cannot press save gift options button. I used every ways(xpath css) but I couldn't. what should I do to press this button?
Snapshot of the button:
sometime x-path does not work. In my case every time buttons does not work when i find using x-path. You have to find button with it's ID and then apply click function.

handle invisible elements/popups with selenium in python

is there a way to interact with invisible popups/elements in selenium using python ?
by invisible or hidden , i do not mean the elements with attribute hidden , neither do i mean that these elements are invisible from the user.
these invisible elements are those that do not appear in the inspect element section
for example: on a webapp screen where right click opens up a small options window which which has different options related to that webapp and its not the traditional browser right click options popup
by default this options popup does not appear in the inspect element , and it only appears when user right clicks on a certain section of the screen, the contents of this options popup differs depending on which setion of the screen the right click was performed on, and it disappears as soon as another click happens anywhere , even if i click on the inspect element section the options popup will disappear.
is there any way to deal with this sort of popup?
Edit 1: when i right click on the screen while the inspect element option is selected something related to the right click popup appears in the inspect element window , but as soon as i click on it to see the element ids , it disappears from the inspect element window
To search xpath of such dynamic elements use DOM break points:
And select break on subtree modification. Now all changes will break and pause the webpage rendering
Click resume execution or press f8 till your pop gets displayed

selenium webdriver opening a screen by clicking a invisible link under main menu

i am using selenium web driver with python.In my test case i have a menu which opens a submenu(has mouse over so i am using action_chains to click) and when click on it moves to next screen.
in that screen i need to check save, delete, reset option function.but whenever i perform click on any of those button and it also clicks on that menu and displays the drop down menu.
this screen is not frame.so i am not able to use driver.switch_to_frame(frame_id).
why i am getting this and what is the solution for this problem.
This my code:(is not one i am using but this is same with my code)
This is my main tab 1 2 3 4 (consider this all menu has submenu)
whatever new screen opens all displayed below this tab.this visible for all screens i am using.
menu= menu element
submenu= sub menu element
hover = ActionChains(driver)
hover.move_to_element(menu).click()
hover.click(submenu)
hover.perform()
Now a new screen opens which have save, reset options
now doing following:
1 st
driver.find_element_by_id("field to fill").clear()
driver.find_element_by_id("field to fill").send_keys(value)
2 nd
driver.find_element_by_id("field to fill").clear()
driver.find_element_by_id("field to fill").send_keys(value)
3rd
driver.find_element_by_id("field to fill").clear()
driver.find_element_by_id("field to fill").send_keys(value)
4 th
driver.find_element_by_id("field to fill").clear()
driver.find_element_by_id("field to fill").send_keys(value)
now i am clicking save button.
driver.find_element_by_id("save").click()
during this time creates a problem when this click occurs it is clicking the menu item again and show the drop down of menu item.
What you are asking is how do you move the mouse (as the user would) to trigger the submenu/drop down menu. (or at least i think that's what you mean)
Start by finding the element, then use the mouse over function provided by selenium. Then move the mouse to the next element (e.g. Save, Delete, Etc)
Here is an example in java, the code will be similar.
How to perform mouseover function in Selenium WebDriver using Java?
I believe Frame refers to another instance of a window, such as when a popup, or another site opens from a page anchor.

Categories