Want to assert the row text in webtable

0 votes
webtable=driver.find_element_by_class_name("dojoxGridScrollbox")        
        for row in webtable.find_elements_by_xpath("//*[@id='dojox_grid__TreeView_1']/div/div/div/div[1]/table/tbody/tr"):
            print(row.text)
        driver.implicitly_wait(5)
       
        #assert webtable.row.text== name
        assert driver.row.find(name)

Traceback (most recent call last):
  File "C:\Users\rajesn\eclipse\Pyhton\GUI_Automation\GuiAutomationTest.py", line 11, in <module>
    obj.peer_node()   
  File "C:\Users\rajesn\eclipse\Pyhton\GUI_Automation\gui_Module.py", line 83, in peer_node
    assert driver.row.find(name)
AttributeError: 'WebDriver' object has no attribute 'row'
Jun 10 in Selenium by anonymous
57 views

1 answer to this question.

0 votes

Hi, you can assert row text at the top by using following code_snippet:

first_row_path = "(//*[@id='dojox_grid__TreeView_1']/div/div/div/div[1]/table/tbody/tr)[1]"
first_row, = webtable.find_elements_by_xpath(first_row_path)
assert first_row.text.find(name) != -1
answered Jun 10 by Anvi
• 13,960 points

Related Questions In Selenium

0 votes
1 answer

How to wait till the text is present In text field

Use Waits in Selenium WebDriver to wait ...READ MORE

answered Jul 5, 2018 in Selenium by Meci Matt
• 9,430 points
539 views
0 votes
1 answer
0 votes
0 answers
0 votes
1 answer

How to input text in the text box without calling the sendKeys()?

Hi Rohan, you can use Javascript Executer ...READ MORE

answered May 29 in Selenium by Abha
• 27,180 points
2,266 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 405 views
0 votes
1 answer

How to capture the text from Alert Message in Selenium Webdriver?

Hello @Farhan, you can use getText() method ...READ MORE

answered Jul 2 in Selenium by Anvi
• 13,960 points
805 views