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
18 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 7,480 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,400 points
105 views
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
• 9,330 points
11 views
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
56 views
0 votes
1 answer

How can I clear the text in a text box using Selenium WebDriver?

Hello Akriti, you can clear the text ...READ MORE

answered May 29 in Selenium by Anvi
• 7,480 points
37 views
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.