Want to assert the row text in webtable

0 votes
        for row in webtable.find_elements_by_xpath("//*[@id='dojox_grid__TreeView_1']/div/div/div/div[1]/table/tbody/tr"):
        #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>
  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

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,400 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,420 points
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
• 24,440 points
+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 279 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,400 points