User create leave
loadpage.Load salt test
LoginLogout.User login to salt ${AdminUser} ${ADMINRPWD} ${USERSTAFFNAME}
User navigates to leave request
Sleep 3
Keywords.User click element ${LeaveRequestBtn}
User select leave type ${LeaveRequestLeaveType} ${LeavetypeDoc}
sleep 3
User select Staff for leave request ${LeaveReuqestStaff} ${LeaveStaffFname}
User click element ${LeaveRequestStartDate}
check that element exist xpath=//div[@id='ContentPlaceHolder1_ContentPlaceHolder1_calExtStartDate_popupDiv']
${classsttrib} = get element attribute xpath=//tbody[@id='ContentPlaceHolder1_ContentPlaceHolder1_calExtStartDate_daysBody']/tr[2]/[td][1] class
log ${classsttrib}
KEYWORD ${classsttrib} = SeleniumLibrary . Get Element Attribute xpath=//tbody[@id='ContentPlaceHolder1_ContentPlaceHolder1_calExtStartDate_daysBody']/tr[2]/[td][1], class
Documentation: Returns value of
attributefrom elementlocator.Start / End / Elapsed: 20181108 16:31:01.496 / 20181108 16:31:02.972 / 00:00:01.476
16:31:01.496 TRACE Arguments: [ "xpath=//tbody[@id='ContentPlaceHolder1_ContentPlaceHolder1_calExtStartDate_daysBody']/tr[2]/[td][1]" | 'class' ]
16:31:01.496 DEBUG POST http://127.0.0.1:52354/session/eba83b94e4377947b449eee1f071482b/elements {"using": "xpath", "sessionId": "eba83b94e4377947b449eee1f071482b", "value": "//tbody[@id='ContentPlaceHolder1_ContentPlaceHolder1_calExtStartDate_daysBody']/tr[2]/[td][1]"}
16:31:01.565 DEBUG http://127.0.0.1:52354 "POST /session/eba83b94e4377947b449eee1f071482b/elements HTTP/1.1" 200 641
16:31:01.565 DEBUG Finished Request
16:31:02.972 FAIL InvalidSelectorException: Message: invalid selector: Unable to locate an element with the xpath expression //tbody[@id='ContentPlaceHolder1_ContentPlaceHolder1_calExtStartDate_daysBody']/tr[2]/[td][1] because of the following error: SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//tbody[@id='ContentPlaceHolder1_ContentPlaceHolder1_calExtStartDate_daysBody']/tr[2]/[td][1]' is not a valid XPath expression. (Session info: chrome=70.0.3538.77) (Driver info: chromedriver=2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 10.0.17134 x86_64)
16:31:02.972 DEBUG Traceback (most recent call last): File "C:\Python27\lib\site-packages\SeleniumLibrary\__init__.py", line 360, in run_keyword return DynamicCore.run_keyword(self, name, args, kwargs) File "C:\Python27\lib\site-packages\SeleniumLibrary\base\robotlibcore.py", line 102, in run_keyword return self.keywords[name](*args, **kwargs) File "C:\Python27\lib\site-packages\SeleniumLibrary\keywords\element.py", line 384, in get_element_attribute return self.find_element(locator).get_attribute(attribute) File "C:\Python27\lib\site-packages\SeleniumLibrary\base\context.py", line 62, in find_element return self.element_finder.find(locator, tag, True, required, parent) File "C:\Python27\lib\site-packages\SeleniumLibrary\locators\elementfinder.py", line 73, in find parent=parent or self.driver) File "C:\Python27\lib\site-packages\SeleniumLibrary\locators\elementfinder.py", line 125, in _find_by_xpath return self._filter_elements(parent.find_elements_by_xpath(criteria), File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 409, in find_elements_by_xpath return self.find_elements(by=By.XPATH, value=xpath) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 995, in find_elements 'value': value})['value'] or [] File "C:\Python27\lib\site-packages\SeleniumLibrary\keywords\browsermanagement.py", line 437, in execute result = self._base_execute(driver_command, params) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 320, in execute self.error_handler.check_response(response) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) I hope someone could help me. Best regards, chris
--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.
//div[@class='mainContainer']/table/tbody/tr/td[2]/div/div/div/div[@id='ContentPlaceHolder1_ContentPlaceHolder1_pnlPopup']/div[@class='popUpContent']/table/tbody/tr[5]/td[3]/div[@id='ContentPlaceHolder1_ContentPlaceHolder1_calExtStartDate_container']/div[@id='ContentPlaceHolder1_ContentPlaceHolder1_calExtStartDate_popupDiv']/div[@id='ContentPlaceHolder1_ContentPlaceHolder1_calExtStartDate_body']/div[@id='ContentPlaceHolder1_ContentPlaceHolder1_calExtStartDate_days']/table[@id='ContentPlaceHolder1_ContentPlaceHolder1_calExtStartDate_daysTable']/tbody[@id='ContentPlaceHolder1_ContentPlaceHolder1_calExtStartDate_daysBody']/tr/tdDatepicker search valid date
${countr} = get element count ${calendardatetable}/tr
log ${countr}
${countr}= evaluate ${countr}+ 1
:FOR ${i} IN RANGE 1 ${countr}
\ ${counttd}= get element count ${calendardatetable}/tr[${i}]/td
\ Datepicker search td date ${i} ${counttd}
Datepicker search td date
[Arguments] ${ctri} ${ctrx}
log ${ctri}
log ${ctrx}
${countx} = get element count ${calendardatetable}/tr[${ctri}]/td
${countx} = evaluate ${countx} + 1
log ${countx}
:FOR ${x} IN RANGE 1 ${countx}
\ ${classsttrib} = get element attribute ${calendardatetable}/tr[${ctri}]/td[${ctrx}] class
\ log ${classsttrib}
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
how do you iterate through the elements in the table. when i check my xpath in google chrome it was able to locate the element.example:
//div[@class='mainContainer']/table/tbody/tr/td[2]/div/div/div/div[@id='ContentPlaceHolder1_ContentPlaceHolder1_pnlPopup']/div[@class='popUpContent']/table/tbody/tr[5]/td[3]/div[@id='ContentPlaceHolder1_ContentPlaceHolder1_calExtStartDate_container']/div[@id='ContentPlaceHolder1_ContentPlaceHolder1_calExtStartDate_popupDiv']/div[@id='ContentPlaceHolder1_ContentPlaceHolder1_calExtStartDate_body']/div[@id='ContentPlaceHolder1_ContentPlaceHolder1_calExtStartDate_days']/table[@id='ContentPlaceHolder1_ContentPlaceHolder1_calExtStartDate_daysTable']/tbody[@id='ContentPlaceHolder1_ContentPlaceHolder1_calExtStartDate_daysBody']
I am trying to get the value of the class using get attribute.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
Datepicker search td date
[Arguments] ${ctri} ${ctrx}
log ${ctri}
log ${ctrx}
${countx} = get element count ${calendardatetable}/tr[${ctri}]/td
${countx} = evaluate ${countx} + 1
log ${countx}
:FOR ${x} IN RANGE 1 ${countx}
\ check that element exist ${calendardatetable}/tr[${ctri}]/td[${ctrx}]
\ ${classsttrib}= SeleniumLibrary.Get Element Attribute ${calendardatetable}/tr[${ctri}]/td[${ctrx}] class
\ log ${classsttrib}
Select Datepicker Date
[Documentation] Select given day from datepicker
[Arguments] ${dateElem} ${expectedMonthYear} ${clickElement}
Input Text ${dateElem} ${Empty} # open the datepicker
${monthyear}= Get Datepicker MonthYear
:FOR ${Index} IN RANGE 1 31
\ Run Keyword If '${monthyear}' == '${expectedMonthYear}' Exit For Loop
\ Click Link //*/div[@id='ui-datepicker-div']//*/a[contains(@class, 'ui-datepicker-prev')]
\ ${monthyear}= Get Datepicker MonthYear
Click Link ${clickElement}
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.