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, 2019 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, 2019 by Anvi
• 14,110 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
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 11, 2019 in Selenium by Vaishnavi
• 1,180 points
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
• 27,930 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, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,468 views
0 votes
0 answers
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, 2019 in Selenium by Anvi
• 14,110 points