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, 2019 in Selenium by anonymous
1,048 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, 2019 by Anvi
• 14,150 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,460 points
7,748 views
0 votes
1 answer
0 votes
0 answers

How to get the text from the HTML5 input error message in Selenium?

On giving invalid data in the email ...READ MORE

Mar 12, 2019 in Selenium by Vaishnavi
• 1,180 points
1,970 views
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, 2019 in Selenium by Abha
• 28,140 points
45,138 views
0 votes
2 answers
+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 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,443 views
0 votes
1 answer
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 3, 2019 in Selenium by Anvi
• 14,150 points
11,068 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP