Skip to content

mpigelati/Selenium_learn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Hellow selinium https://chercher.tech/python/table-selenium-python

def listgroups(driver): #time.sleep(30) driver.find_element_by_id("Group").click() # here we can use by ID or Xpath # Alternative (driver.find_element_by_xpath("//*[@id='Group']/div").click())

mypath="//*[@id = 'tableOrgGroupsConversations']/tbody/tr"
mypath1 = "//*[@id = 'tableOrgGroupsConversations']/tbody"

Rows = len(driver.find_elements_by_xpath(mypath))
print("number of rows", Rows)

for count in range(1,Rows+1):

    print("===================>Starting index",count)
    temp = Rows
    #print("===================>Rows", Rows)
    string = mypath1 + '/tr[' + str(temp) + ']/td/span/a/span[1]'
    string1 = mypath1 + '/tr[' + str(temp) + ']/td[2]/span'

    data1 = driver.find_element_by_xpath(string1)
    #print("mystring", string1)
    if data1.text != "Member":
        print("Admin-Member-->", data1.text)

        print("mystring",string)
        data=driver.find_element_by_xpath(string)
        print("Group-->",data.text)

        select_element= driver.find_element_by_xpath(mypath1+'/tr[' + str(temp)+']/td[5]')
        select_element.click()
        driver.find_element_by_xpath(mypath1+'/tr[' + str(temp)+']/td[5]/div/ul/li[3]/a').click()
        driver.find_element_by_xpath("//*[@id='delete-group-modal']/div/div/div[2]/button[2]").click()
        time.sleep(50)
        #print("Deleted Group ",data.text)
        time.sleep(50)
        temp = temp - count
        print("Temp-->",temp)
        driver.refresh()
    print("----------------------------------------")

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages