Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Defining function in selenium
#1
Hey I am very early at programming but the problem is I am having a lot of trouble while defining functions. This has made my code pages and pages long.
How do I define a function that Searches an element by xpath using selenium?
def function(self,...): 
     browser.find_element_by_xpath(“”)
     return 
How do I use it?
Element.function?
Reply


Messages In This Thread
Defining function in selenium - by AgileAVS - Jul-01-2020, 09:22 AM
RE: Defining function in selenium - by Larz60+ - Jul-01-2020, 10:06 AM
RE: Defining function in selenium - by AgileAVS - Jul-01-2020, 01:09 PM
RE: Defining function in selenium - by musaab - Jul-01-2020, 01:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Error in Selenium: CRITICAL:root:Selenium module is not installed...Exiting program. AcszE 1 3,632 Nov-03-2017, 08:41 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020