Re: [Tutor] How to get Selenium to wait for page load

2019-01-31 Thread Mark Lawrence

On 31/01/2019 11:14, Marco Mistroni wrote:

Hi
You won't find much help here as this is a python moist


I've no idea what the above is meant to mean.


Have a look at WebDriverWait from selenium.webdriver.support.ui

It allows you to wait for certain conditions
Hth



Please don't top post here as it's so damn irritating when reading long 
threads.


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to get Selenium to wait for page load

2019-01-31 Thread Marco Mistroni
Hi
You won't find much help here as this is a python moist
Have a look at WebDriverWait from selenium.webdriver.support.ui

It allows you to wait for certain conditions
Hth

On Thu, Jan 31, 2019, 11:09 AM  Hi all,
>
>
>
> I have found an excellent article on identifying stale elements. The issue
> is when I try and use their example code. I get a failure where for_wait is
> not defined.
>
>
> http://www.obeythetestinggoat.com/how-to-get-selenium-to-wait-for-page-load-
> after-a-click.html
> 
>
>
>
> Traceback (most recent call last):
> File "", line 5, in 
> NameError: name 'wait_for' is not defined
> >>>
>
>
>
> When I look through the examples. I only find one reference for the above
> function. But it doesn't look correct and I am confused. The author
> indicates the definition of the function is half way up the page. As I
> cannot see, this reference doesn't help. So can someone help and provide
> the
> definition for this method/function?
>
>
>
> The code which generated the error:
>
>
>
> rows = []
>
> pageNav = browser.find_element_by_id("center-5")
>
> curr_page = pageNav.find_element_by_css_selector('span
> .pageNumberElement').text
>
> prev_page = ""
>
> while prev_page in curr_page:
>
> #wait_for(link_has_gone_stale):
>
> prev_page = curr_page
>
> rows.extend(tableNavigation (pageNav))
>
> if wait_for(link_has_gone_stale):
>
> pageNav = browser.find_element_by_id("center-5")
>
> curr_page = pageNav.find_element_by_css_selector('span
> .pageNumberElement').text
>
> if prev_page == curr_page:
>
> print ("Page no has not changed:",curr_page)
>
> else:
>
> prev_page = curr_page
>
>
>
>
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] How to get Selenium to wait for page load

2019-01-31 Thread mhysnm1964
Hi all,

 

I have found an excellent article on identifying stale elements. The issue
is when I try and use their example code. I get a failure where for_wait is
not defined.

http://www.obeythetestinggoat.com/how-to-get-selenium-to-wait-for-page-load-
after-a-click.html

 

Traceback (most recent call last): 
File "", line 5, in  
NameError: name 'wait_for' is not defined 
>>>

 

When I look through the examples. I only find one reference for the above
function. But it doesn't look correct and I am confused. The author
indicates the definition of the function is half way up the page. As I
cannot see, this reference doesn't help. So can someone help and provide the
definition for this method/function?

 

The code which generated the error:

 

rows = []

pageNav = browser.find_element_by_id("center-5")

curr_page = pageNav.find_element_by_css_selector('span
.pageNumberElement').text

prev_page = ""

while prev_page in curr_page:

#wait_for(link_has_gone_stale):

prev_page = curr_page  

rows.extend(tableNavigation (pageNav))

if wait_for(link_has_gone_stale):

pageNav = browser.find_element_by_id("center-5")

curr_page = pageNav.find_element_by_css_selector('span
.pageNumberElement').text

if prev_page == curr_page:

print ("Page no has not changed:",curr_page)

else:

prev_page = curr_page

 

 

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor