Jump to content

Clicking on unlisted element.


Recommended Posts

Need help in selecting check box which has name related to "WhosOnDuty_GroupRow_checkbox_XYZ_Software_INC.*"

 

<div aria-checked="false" class="Checkbox-module__wrapper--1Bxzk" role="checkbox" tabindex="0" data-testid="WhosOnDuty_GroupRow_checkbox_XYZ_Software_INC.*IT-Applications*Finance Apps Admin" style="" xpath="1"><svg class="Checkbox-module__svg--2-_cA" width="1000" height="1000" viewBox="0 0 1000 1000"><g fill="none" fill-rule="evenodd"><rect fill="#FFFFFF" x="70" y="70" width="860" height="860" rx="71"></rect><path d="M142.857143,71.4285714 C103.408232,71.4285714 71.4285714,103.408232 71.4285714,142.857143 L71.4285714,857.142857 C71.4285714,896.591768 103.408232,928.571429 142.857143,928.571429 L857.142857,928.571429 C896.591768,928.571429 928.571429,896.591768 928.571429,857.142857 L928.571429,142.857143 C928.571429,103.408232 896.591768,71.4285714 857.142857,71.4285714 L142.857143,71.4285714 Z M142.857143,1.58603289e-14 L857.142857,1.58603289e-14 C936.040679,5.55820477e-14 1000,63.9593215 1000,142.857143 L1000,857.142857 C1000,936.040679 936.040679,1000 857.142857,1000 L142.857143,1000 C63.9593215,1000 7.97375388e-14,936.040679 0,857.142857 L1.58603289e-14,142.857143 C-9.66219644e-15,63.9593215 63.9593215,1.44932947e-14 142.857143,1.58603289e-14 Z" fill="#CCCCCC" fill-rule="nonzero"></path></g></svg></div>

 

The xpath to above shows "//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]"

However there are 9-14 check boxes to be selected, out of  which some have the same xpath as above, and rest have different , out of which 3 checkboxes are unrequired.

 

Edited by Cyborg5000
Link to comment
Share on other sites

image.thumb.png.58c35b5ef57b02de971eb9225e19ac7a.png

 

These are the check boxes...and each have the same HTML as below only with difference in the name of element "DATA-TESTID"

 

<div aria-checked="false" class="Checkbox-module__wrapper--1Bxzk" role="checkbox" tabindex="0" data-testid="WhosOnDuty_GroupRow_checkbox_XYZ_Software_INC.*IT-Applications*Finance Apps Admin" style="" xpath="1"><svg class="Checkbox-module__svg--2-_cA" width="1000" height="1000" viewBox="0 0 1000 1000"><g fill="none" fill-rule="evenodd"><rect fill="#FFFFFF" x="70" y="70" width="860" height="860" rx="71"></rect><path d="M142.857143,71.4285714 C103.408232,71.4285714 71.4285714,103.408232 71.4285714,142.857143 L71.4285714,857.142857 C71.4285714,896.591768 103.408232,928.571429 142.857143,928.571429 L857.142857,928.571429 C896.591768,928.571429 928.571429,896.591768 928.571429,857.142857 L928.571429,142.857143 C928.571429,103.408232 896.591768,71.4285714 857.142857,71.4285714 L142.857143,71.4285714 Z M142.857143,1.58603289e-14 L857.142857,1.58603289e-14 C936.040679,5.55820477e-14 1000,63.9593215 1000,142.857143 L1000,857.142857 C1000,936.040679 936.040679,1000 857.142857,1000 L142.857143,1000 C63.9593215,1000 7.97375388e-14,936.040679 0,857.142857 L1.58603289e-14,142.857143 C-9.66219644e-15,63.9593215 63.9593215,1.44932947e-14 142.857143,1.58603289e-14 Z" fill="#CCCCCC" fill-rule="nonzero"></path></g></svg></div>

 

The xpaths for 5-6 checkboxes are same ""//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]" with only the difference in number "//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[2]/div[1]"

which goes like "//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[2]/div[1]"

"//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[3]/div[1]"

"//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[3]/div[1]"

 

Using xpath iam able to get the checkboxes selected, but as the rest of the checkboxes have the same xpath, the script unchecks it back again which was selected.

;==========Select "XYZ Software Inc.*IT-Applications*Finance Apps Admin"==================
$xpathForumLink = ("//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]")
$aForumLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE1, $xpathForumLink)
_IEAction($aForumLink[0], "focus")
_IEAction($aForumLink[0], "click")
;=================END==============================

;==========Select "XYZ Software Inc.*IT-Application Support Services*Application Integration Support"==================
$xpathForumLink = ("//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[2]/div[1]")
$aForumLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE1, $xpathForumLink)
_IEAction($aForumLink[0], "focus")
_IEAction($aForumLink[0], "click")
;=================END==============================

;==========Select "XYZ Software Inc.*IT-Application Support Services*Business Analytics Support"==================
$xpathForumLink = ("//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[3]/div[1]")
$aForumLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE1, $xpathForumLink)
_IEAction($aForumLink[0], "focus")
_IEAction($aForumLink[0], "click")

 

 

 

 

 

Edited by Cyborg5000
Link to comment
Share on other sites

well actually i thought you use Webdriver...

2nd: it would be much easier to post the site you want to access..

 

you can search the attributes aswell. try:

Quote

"//*[@data-testid='WhosOnDuty_GroupRow_checkbox_XYZ_Software_INC.*IT-Applications*Finance Apps Admin']"

with the different values or when you have other attributes with different values you also can change the @data-testid into it (+ the searching value).

normally this should work too

("//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]")
("//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[2]")
("//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[3]")

why do i get garbage when i buy garbage bags? <_<

Link to comment
Share on other sites

9 minutes ago, Aelc said:

well actually i thought you use Webdriver...

2nd: it would be much easier to post the site you want to access..

 

you can search the attributes aswell. try:

with the different values or when you have other attributes with different values you also can change the @data-testid into it (+ the searching value).

normally this should work too


("//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]")

("//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[2]")

("//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[3]")

you can search the attributes aswell. try:
 Any example that i can try to search with? with new chrome and webdriver its not working...hence moved on to xpath..

Link to comment
Share on other sites

1 hour ago, Cyborg5000 said:

 

;==========Select "XYZ Software Inc.*IT-Applications*Finance Apps Admin"==================
$xpathForumLink = ("//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]")
$aForumLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE1, $xpathForumLink)
_IEAction($aForumLink[0], "focus")
_IEAction($aForumLink[0], "click")
;=================END==============================

;==========Select "XYZ Software Inc.*IT-Application Support Services*Application Integration Support"==================
$xpathForumLink = ("//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[2]/div[1]")
$aForumLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE1, $xpathForumLink)
_IEAction($aForumLink[0], "focus")
_IEAction($aForumLink[0], "click")
;=================END==============================

;==========Select "XYZ Software Inc.*IT-Application Support Services*Business Analytics Support"==================
$xpathForumLink = ("//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[3]/div[1]")
$aForumLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE1, $xpathForumLink)
_IEAction($aForumLink[0], "focus")
_IEAction($aForumLink[0], "click")

 

i don't have the function, so i can't write an example ...

normally you just have to change the $xpathForumLink like this..

;==========Select "XYZ Software Inc.*IT-Applications*Finance Apps Admin"==================
$xpathForumLink = ("//*[@data-testid='WhosOnDuty_GroupRow_checkbox_XYZ_Software_INC.*IT-Applications*Finance Apps Admin']")
$aForumLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE1, $xpathForumLink)
_IEAction($aForumLink[0], "focus")
_IEAction($aForumLink[0], "click")
;=================END==============================

;==========Select "XYZ Software Inc.*IT-Application Support Services*Application Integration Support"==================
$xpathForumLink = ("//*[@data-testid='WhosOnDuty_GroupRow_checkbox_XYZ_Software_INC.*IT-Application Support Services*Application Integration Support']")
$aForumLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE1, $xpathForumLink)
_IEAction($aForumLink[0], "focus")
_IEAction($aForumLink[0], "click")
;=================END==============================

;==========Select "XYZ Software Inc.*IT-Application Support Services*Business Analytics Support"==================
$xpathForumLink = ("//*[@data-testid='WhosOnDuty_GroupRow_checkbox_XYZ_Software_INC.*IT-Application Support Services*Business Analytics Support']")
$aForumLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE1, $xpathForumLink)
_IEAction($aForumLink[0], "focus")
_IEAction($aForumLink[0], "click")

 

But still i don't know the site or the other values... i'm sadly not able to Clairvoyance. :P 

Also i'm sure there is a way with webdriver

 

EDIT: i tried this with an own created element based on your posted element. i used webdriver where the element could be found

Edited by Aelc

why do i get garbage when i buy garbage bags? <_<

Link to comment
Share on other sites

RunWait("taskkill /F /IM iexplore.exe /T", "", @SW_HIDE)
Global $oIE1 = _IECreate("https://XYZ.okta.com/login/sso_iwa_auth", 0, 1, 1, 1) ;1, 0, 1, 1)
Sleep(6000)


_IENavigate($oIE1, "https://XYZ.okta.com/home/XYZ_nocalert_1/0oa1ddtojvfGTCooO1d8/aln1ddttkav7HWc4p1d8?fromHome=true", 1)
Sleep(6000)
_IENavigate($oIE1, "https://XYZit.xmatters.com/xmatters/app.do#WhosOnDutyGroupSelectionPlace:", 1)
$url = ("https://XYZit.xmatters.com/xmatters/app.do#WhosOnDutyGroupSelectionPlace:")
Sleep(6000)
$oIE = _IEAttach($url, "url")

$xpathForumLink = "//table/tbody/tr/td[.='Search item']"

;==========Select "XYZ Software Inc.*IT-Applications*Finance Apps Admin"==================
$xpathForumLink = ("//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]")
$aForumLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE1, $xpathForumLink)
_IEAction($aForumLink[0], "focus")
_IEAction($aForumLink[0], "click")
;=================END==============================

;==========Select "XYZ Software Inc.*IT-Application Support Services*Application Integration Support"==================
$xpathForumLink = ("//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[2]/div[1]")
$aForumLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE1, $xpathForumLink)
_IEAction($aForumLink[0], "focus")
_IEAction($aForumLink[0], "click")
;=================END==============================

;==========Select "XYZ Software Inc.*IT-Application Support Services*Business Analytics Support"==================
$xpathForumLink = ("//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[3]/div[1]")
$aForumLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE1, $xpathForumLink)
_IEAction($aForumLink[0], "focus")
_IEAction($aForumLink[0], "click")
;=================END==============================

;==========Select "XYZ Software Inc.*IT-Application Support Services*Digital Solutions Support"==================
$xpathForumLink = ("//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[4]/div[1]")
$aForumLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE1, $xpathForumLink)
_IEAction($aForumLink[0], "focus")
_IEAction($aForumLink[0], "click")
;=================END==============================

;==========Select "XYZ Software Inc.*IT-Application Support Services*IS&T PMO Project Forms site"==================
$xpathForumLink = ("//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[5]/div[1]")
$aForumLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE1, $xpathForumLink)
_IEAction($aForumLink[0], "focus")
_IEAction($aForumLink[0], "click")
;=================END==============================

$xpathForumLink = ("//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[3]/div[1]")
$aForumLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE1, $xpathForumLink)
_IEAction($aForumLink[0], "focus")
_IEAction($aForumLink[0], "click")

Above is the code that works for me and the check boxes, however as i mentioned earlier, the xpath of few of the checkboxes are same....like from 9-13 (/div[3]/div[1]")

Hence even if i go till 1-9 (/div[3]/div[1]") a few check boxes having the same xpaths remain un-checked..

Only unique are the data-testid="WhosOnDuty_GroupRow_checkbox_XYZ_Software_INC.*IT-Applications*Finance Apps Admin"

Link to comment
Share on other sites

Why don't you use _IETagNameGetCollection to get all div tags, then use the method getAttribute("data-testid") to get the ones you need.  It is way more robust and easy than using xpath IMO. (Untested of course)

Link to comment
Share on other sites

You've contradicted yourself in a few places. First you said this --

16 hours ago, Cyborg5000 said:

The xpath to above shows "//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]"

However there are 9-14 check boxes to be selected, out of  which some have the same xpath as above

Then you said this --

8 hours ago, Cyborg5000 said:

The xpaths for 5-6 checkboxes are same ""//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]" with only the difference in number "//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[2]/div[1]"

AFAIK, each element should be able to be addressed by a unique xpath.

Link to comment
Share on other sites

13 minutes ago, Danp2 said:

You've contradicted yourself in a few places. First you said this --

Then you said this --

AFAIK, each element should be able to be addressed by a unique xpath.

Hi @Danp2

Thanks for helping over here.

What i meant to say is if xpath of 1-9 check boxes are unique like ""//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]"

div[1]/div[1]

div[2]/div[1]

div[3]/div[1]

But after the 9th checkbox the xpath are not unique and they have the same as previous checkboxes"//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[2]/div[1]" like example below.

//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[2]/div[1]"

//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[3]/div[1]"

//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[4]/div[1]"

//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[2]/div[1]"

 

 

Only unique are the data-testid="WhosOnDuty_GroupRow_checkbox_XYZ_Software_INC.*IT-Applications*Finance Apps Admin"

Edited by Cyborg5000
Link to comment
Share on other sites

  • 2 weeks later...

Sorry guys it dint work :-

Below is the HTML

Tried setting it to 

$xpathForumLink = ("//*[@data-testid='WhosOnDuty_GroupRow_checkbox_XYZ_Software_INC.*IT-Application Support Services*Business Analytics Support']")
$aForumLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE1, $xpathForumLink)
_IEAction($aForumLink[0], "focus")
_IEAction($aForumLink[0], "click")

But some of the check boxes are not getting selected.

This is the last checkbox it selects and then errors out.

Start Function=[BGe_IEGetDOMObjByXPathWithAttributes] with $sXPath=[//*[@data-testid='WhosOnDuty_GroupRow_checkbox_XYZ Software Inc.*IT-Application Support Services*Quarter end support – CPQ']].
@data-testid='WhosOnDuty_GroupRow_checkbox_XYZ Software Inc.*IT-Application Support Services*Quarter end support – CPQ'
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[0]: $sNodeName=[*], $bNodeIsRelative=[True] $bIsConstrainted=[True].
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[0]: $sNodeName=[*], $bNodeIsRelative=[True] $bIsConstrainted=[True].

 

xMatters®.html

Edited by Cyborg5000
Link to comment
Share on other sites

Try this :

#include <Constants.au3>
#include <IE.au3>

Local $oIE = _IEAttach("xMatters®")
Local $hWnd = _IEPropertyGet($oIE, "hwnd")
WinActivate($hWnd)
WinWaitActive($hWnd)
Local $oTags = _IETagNameGetCollection($oIE, "div")
For $oTag in $oTags
  If StringInStr($oTag.getAttribute("data-testid"), "WhosOnDuty") Then
    ConsoleWrite ($oTag.getAttribute("data-testid") & @CRLF)
    _IEAction($oTag, "focus")
    _IEAction($oTag, "click")
  EndIf
Next

You may have to put some sleep after actions...

Edited by Nine
Link to comment
Share on other sites

Team,

Need some help again.

Iam trying to set Time from 12:00 AM and 12:00 PM

image.png.31b5598770c23534d72bbe2a0ea234a3.png

but when iam using xpath, it does set, but changes for both From and to:-

 

So far i have tried all xpath that i can figure out.

 

;$xpathForumLink = ("//div[@id='compact-header']/div[@class='whos-on-duty-header']//div[@class='date-time fromDate']/div[2]/input")
$xpathForumLink = ("//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/input[1]")
$aForumLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE1, $xpathForumLink)
_IEAction($aForumLink[0], "focus")
_IEAction($aForumLink[0], "click")
_IEPropertySet($aForumLink[0], "innertext", "12:00 PM")

sleep (4000)

;$xpathForumLink = ("//div[@id='compact-header']/div[@class='whos-on-duty-header']//div[@class='date-time toDate']/div[2]")
;$xpathForumLink = ("//div[@id='compact-header']/div[@class='whos-on-duty-header']//div[@class='date-time toDate']/div[2]/input")
;$xpathForumLink = ("//div[@id='compact-header']/div[@class='whos-on-duty-header']//div[@class='date-time toDate']/div[2]/input")
$xpathForumLink = ("//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/input[1]")
$aForumLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE1, $xpathForumLink)
_IEAction($aForumLink[0], "focus")
_IEAction($aForumLink[0], "click")
_IEPropertySet($aForumLink[0], "innertext", "12:00 AM")

 

IN console i get:-

Start Function=[BGe_IEGetDOMObjByXPathWithAttributes] with $sXPath=[//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/input[1]].
@id='reactPage'
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[0]: $sNodeName=[body], $bNodeIsRelative=[True] $bIsConstrainted=[False].
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[1]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[True].
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[2]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[3]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[4]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[5]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[6]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[7]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[8]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[9]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[10]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[11]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[12]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[13]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[14]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[15]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[16]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[17]: $sNodeName=[input], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_IEGetDOMObjByXPathWithAttributes] with $sXPath=[//body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/input[1]].
@id='reactPage'
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[0]: $sNodeName=[body], $bNodeIsRelative=[True] $bIsConstrainted=[False].
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[1]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[True].
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[2]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[3]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[4]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[5]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[6]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[7]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[8]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[9]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[10]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[11]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[12]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[13]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[14]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[15]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[16]: $sNodeName=[div], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.
Start Function=[BGe_RecursiveGetObjWithAttributes] level=[17]: $sNodeName=[input], $bNodeIsRelative=[False] $bIsConstrainted=[False].
    found a condition for predicate in b1.

 

Edited by Cyborg5000
Link to comment
Share on other sites

4 minutes ago, Danp2 said:

Use _IEFormElementSetValue instead of _IEPropertySet.

Hi @Danp2

I did tried using _IEFormElementSetValue, but still it changes time for both the boxes FROM & TO:- :(

 

image.png.e8e288f21ae55ff083e4fefeb1b6ad1d.png

Xpaths are as below:-

 

From Time Xpath //body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/input[1]
      /html[1]/body[1]/div[2]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/input[1]
      /html//div[@id='compact-header']/div[@class='whos-on-duty-header']/div[@class='whos-on-duty-header-title-bar']//div[@class='date-time fromDate']/div[2]/input[@value='1:58 AM']

TO Time xpath /html//div[@id='compact-header']/div[@class='whos-on-duty-header']/div[@class='whos-on-duty-header-title-bar']//div[@class='date-time toDate']/div[2]/input[@value='1:58 AM']
      //body/div[@id='reactPage']/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/input[1]
      /html[1]/body[1]/div[2]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/input[1]

Link to comment
Share on other sites

47 minutes ago, Danp2 said:

Sorry... but I don't see how a single call to _IEFormElementSetValue could possibly change the value of both elements.

Care to elaborate?

HI @Danp2

I have tried using _IEFormElementSetValue but that just sets the value, and when moved on to another window/xpath the value resets.

image.png.cdf7352d28c92f0e860fa28d407b6006.png

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...